OffscreenCanvas
open external class OffscreenCanvas(width: JsLong, height: JsLong) : EventTarget, CanvasImageSource, TexImageSource, GPUCopyExternalImageSource, Transferable(source)
Properties
Functions
Link copied to clipboard
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
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.