Skip to main content

method OffscreenCanvas.getContext

Overload 1

#OffscreenCanvas.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.

Parameters #

#contextId: "bitmaprenderer"
#options: any
optional

Return Type #

Overload 2

#OffscreenCanvas.getContext(
contextId: "webgpu",
options?: any,
): GPUCanvasContext | null

Parameters #

#contextId: "webgpu"
#options: any
optional

Return Type #

Overload 3

#OffscreenCanvas.getContext(
options?: any,
): OffscreenRenderingContext | null

Parameters #

#options: any
optional

Return Type #

Overload 4

#OffscreenCanvas.getContext(
contextId:
"2d"
| "webgl"
| "webgl2"
,
options?: any,
): null

Parameters #

#contextId:
"2d"
| "webgl"
| "webgl2"
#options: any
optional

Return Type #

null

Did you find what you needed?

Privacy policy