MDN self-hosted library · e01.org

ImageBitmap

Canvas API

no runnable cells web-api-interface upstream source

Canvas API

The ImageBitmap interface represents a bitmap image which can be drawn to a canvas without undue latency. It can be created from a variety of source objects using the Window.createImageBitmap() or WorkerGlobalScope.createImageBitmap() factory method. ImageBitmap provides an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL.

ImageBitmap is a transferable object.

Instance properties

  • ImageBitmap.height
  • : An unsigned long representing the height, in CSS pixels, of the ImageBitmap.
  • ImageBitmap.width
  • : An unsigned long representing the width, in CSS pixels, of the ImageBitmap.

Instance methods

  • ImageBitmap.close()
  • : Disposes of all graphical resources associated with an ImageBitmap.

Specifications

Browser compatibility

See also

  • Window.createImageBitmap
  • WorkerGlobalScope.createImageBitmap
  • CanvasRenderingContext2D.drawImage()
  • WebGLRenderingContext.texImage2D()
  • OffscreenCanvas.transferToImageBitmap()