OffscreenCanvas
open class OffscreenCanvas( var width: UInt53, var height: UInt53) : EventTarget, CanvasImageSource, TexImageSource, GPUCopyExternalImageSource, Transferable(source)
When using the canvas element or the Canvas API, rendering, animation, and user interaction usually happen on the main execution thread of a web application.
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 : JsAny> 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.
Link copied to clipboard