ImageBitmapRenderingContext

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

ImageBitmapRenderingContext 接口是 canvas 的渲染上下文,它只提供了使用给定 ImageBitmap 替换 canvas 的功能。它的上下文 ID (HTMLCanvasElement.getContext()OffscreenCanvas.getContext() 的第一个参数) 是 "bitmaprenderer"

这个接口可用于 window context 和 worker context.

方法

ImageBitmapRenderingContext.transferFromImageBitmap()

在与此渲染上下文相关的 canvas 中显示给定的 ImageBitmapImageBitmap 的所有权被转移到画布上。这个函数以前命名为transferImageBitmap(),但在规范中修改了原名字。为了避免影响之前的代码,旧名称作为别名被保留下来。

规范

Currently drafted as a proposal in the OffscreenCanvas specification.

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ImageBitmapRenderingContext
canvas
transferFromImageBitmap

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Uses a non-standard name.
Has more compatibility info.

相关链接