interface OffscreenCanvas
extends EventTarget
A canvas that can be rendered to off the main thread and without being
attached to the DOM. It exposes drawing contexts via
OffscreenCanvas.getContext and can produce a Blob or
ImageBitmap from its contents.
Properties #
Methods #
#convertToBlob(options?: ImageEncodeOptions): Promise<Blob> Create a Blob object representing the image contained in the canvas.
#getContext(contextId: "bitmaprenderer",options?: any,): ImageBitmapRenderingContext | null Get a drawing context for the canvas. If this was previously called, it will return the same context.
#getContext(contextId: "webgpu",options?: any,): GPUCanvasContext | null #getContext(contextId: OffscreenRenderingContextId,options?: any,): OffscreenRenderingContext | null #getContext(contextId: "2d"
| "webgl"
| "webgl2",options?: any,): null Create an ImageBitmap object representing the image contained in the canvas.
See #
variable OffscreenCanvas
The constructor object for OffscreenCanvas, used to create a new
offscreen canvas with the given width and height that can be rendered to
without being attached to the DOM.