ImageBitmapRenderingContext
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
ImageBitmapRenderingContext
接口是 canvas 的渲染上下文,它只提供了使用给定 ImageBitmap
替换 canvas 的功能。它的上下文 ID (HTMLCanvasElement.getContext()
或 OffscreenCanvas.getContext()
的第一个参数) 是 "bitmaprenderer"
。
这个接口可用于 window context 和 worker context.
方法
ImageBitmapRenderingContext.transferFromImageBitmap()
-
在与此渲染上下文相关的 canvas 中显示给定的
ImageBitmap
。ImageBitmap
的所有权被转移到画布上。这个函数以前命名为transferImageBitmap()
,但在规范中修改了原名字。为了避免影响之前的代码,旧名称作为别名被保留下来。
规范
Currently drafted as a proposal in the OffscreenCanvas specification.