OffscreenCanvas()
Baseline 2023
Newly available
Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
语法
new OffscreenCanvas(width, height);
参数
示例
创建一个离屏 Canvas 并且初始一个 WebGL 上下文:
js
var offscreen = new OffscreenCanvas(256, 256);
var gl = offscreen.getContext("webgl");
规范
Specification |
---|
HTML Standard # dom-offscreencanvas-dev |
浏览器兼容性
BCD tables only load in the browser
查看更多
OffscreenCanvas
, the interface this constructor belongs to.