ImageBitmapRenderingContext
The ImageBitmapRenderingContext interface is a canvas rendering context that provides the functionality to replace the canvas's contents with the given ImageBitmap. Its context id (the first argument to HTMLCanvasElement.getContext() or OffscreenCanvas.getContext()) is "bitmaprenderer".
This interface is available in both the window and the worker context.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 66 | 79 | 46 | 11.1 | 66 | 11.3 | |
getContext (bitmaprenderer context) `bitmaprenderer` context | 66 | 79 | 46 | 11.1 | 66 | 11.3 |
getContext (bitmaprenderer context options alpha parameter) `options.alpha` parameter | 66 | 79 | | 11.1 | 66 | 11.3 |
| The ImageBitmapRenderingContext.canvas property, part of the Canvas API, is a read-only reference to the HTMLCanvasElement or OffscreenCanvas object that is associated with the given context. | 66 | 79 | 97 | 11.1 | 66 | 11.3 |
| The ImageBitmapRenderingContext.transferFromImageBitmap() method displays the given ImageBitmap in the canvas associated with this rendering context. The ownership of the ImageBitmap is transferred to the canvas as well. | 66 | 79 | 50 | 11.1 | 66 | 11.3 |
- This feature was removed in a later browser version (52)
- Previously available under a different name: transferImageBitmap (46)
Use cases
-
Using ImageBitmapRenderingContext
The ImageBitmapRenderingContext interface is a canvas rendering context that provides the functionality to replace the canvas's contents with the given ImageBitmap.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.