Constructors

Link copied to clipboard
constructor(width: JsLong, height: JsLong)

Properties

Link copied to clipboard

These attributes return the dimensions of the OffscreenCanvas object's bitmap.

Link copied to clipboard

These attributes return the dimensions of the OffscreenCanvas object's bitmap.

Functions

Link copied to clipboard
suspend fun convertToBlob(options: ImageEncodeOptions = definedExternally): Blob

Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.

Link copied to clipboard
fun convertToBlobAsync(options: ImageEncodeOptions = definedExternally): Promise<Blob>
Link copied to clipboard
Link copied to clipboard
fun <T : OffscreenRenderingContext, O : Any> getContext(contextId: RenderingContextId<T, O>, options: O? = definedExternally): T?

Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.

Link copied to clipboard

Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.