OffscreenCanvas.transferToImageBitmap()
Baseline 2023Newly available
Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
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 |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
transferToImageBitmap |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
浏览相关
- The interface defining this method,
OffscreenCanvas
ImageBitmapRenderingContext.transferImageBitmap()