This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
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.
Methods
ImageBitmapRenderingContext.transferFromImageBitmap()
-
Displays the given
ImageBitmap
in the canvas associated with this rendering context. Ownership of theImageBitmap
is transferred to the canvas. This was previously namedtransferImageBitmap()
, but was renamed in a spec change. The old name is being kept as an alias to avoid code breakage.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'ImageBitmapRenderingContext' in that specification. |
Living Standard |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ImageBitmapRenderingContext | Chrome Full support 66 | Edge Full support ≤79 | Firefox Full support 46 | IE No support No | Opera Full support Yes | Safari No support No | WebView Android Full support 66 | Chrome Android Full support 66 | Firefox Android Full support 46 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support 9.0 |
transferFromImageBitmap | Chrome Full support 66 | Edge Full support ≤79 | Firefox
Full support
52
| IE No support No | Opera Full support Yes | Safari No support No | WebView Android Full support 66 | Chrome Android Full support 66 | Firefox Android
Full support
52
| Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support 9.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Uses a non-standard name.
- Uses a non-standard name.