OffscreenCanvas.transferToImageBitmap()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2023年3月.
OffscreenCanvas.transferToImageBitmap()
方法使用offscreenCanvas
最近渲染得到的图片创建一个ImageBitmap
对象。
语法
ImageBitmap OffscreenCanvas.transferToImageBitmap()
返回值
一个ImageBitmap
对象。
例子
js
var offscreen = new OffscreenCanvas(256, 256); var gl = offscreen.getContext("webgl"); //一些绘制要使用 gl 前后文 offscreen.transferToImageBitmap(); // ImageBitmap { width: 256, height: 256 }
Specifications
Specification |
---|
HTML> # dom-offscreencanvas-transfertoimagebitmap-dev> |
浏览器兼容性
Loading…
浏览相关
- The interface defining this method,
OffscreenCanvas
ImageBitmapRenderingContext.transferImageBitmap()