Baseline 2023
Newly available
Note: This feature is available in Web Workers.
The OffscreenCanvas()
constructor returns a newly instantiated OffscreenCanvas
object.
new OffscreenCanvas(width, height)
Parameters
width
The width of the offscreen canvas.
height
The height of the offscreen canvas.
This example creates a new offscreen canvas using the OffscreenCanvas()
constructor. We then initialize a WebGL context on it using the getContext()
method.
const offscreen = new OffscreenCanvas(256, 256);
const gl = offscreen.getContext("webgl");
Specifications Browser compatibility See also
OffscreenCanvas
, the interface this constructor belongs toRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3