ImageBitmapRenderingContext

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

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.

方法

ImageBitmapRenderingContext.transferFromImageBitmap()

Displays the given ImageBitmap in the canvas associated with this rendering context. Ownership of the ImageBitmap is transferred to the canvas. This was previously named transferImageBitmap() , but was renamed in a spec change. The old name is being kept as an alias to avoid code breakage.

规范

规范 状态 Comment
HTML Living Standard
The definition of 'ImageBitmapRenderingContext' in that specification.
实时标准

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
ImageBitmapRenderingContext
Chrome 66 Edge ≤79 Firefox 46 IE 不支持 No Opera Yes Safari 不支持 No WebView Android 66 Chrome Android 66 Firefox Android 46 Opera Android Yes Safari iOS ? Samsung Internet Android 9.0
transferFromImageBitmap
Chrome 66 Edge ≤79 Firefox 52
52
46 — 52
Alternate Name
Alternate Name Uses the non-standard name: transferImageBitmap
IE 不支持 No Opera Yes Safari 不支持 No WebView Android 66 Chrome Android 66 Firefox Android 52
52
46 — 52
Alternate Name
Alternate Name Uses the non-standard name: transferImageBitmap
Opera Android Yes Safari iOS ? Samsung Internet Android 9.0

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
使用非标名称。
使用非标名称。

另请参阅