ImageBitmapRenderingContext Class

The rendering context of a canvas that displays image bitmaps (https://html.spec.whatwg.org/multipage/canvas.html#the-imagebitmaprenderingcontext-interface): canvas.getContext("bitmaprenderer"). Its output bitmap is the bitmap of the canvas: the bitmaps given to ImageBitmapRenderingContext.TransferFromImageBitmap are displayed without copy.

public sealed class ImageBitmapRenderingContext

Properties

NameDescription
CanvasGets the canvas of the context: an HtmlCanvasElement or an OffscreenCanvas.

Methods

NameDescription
TransferFromImageBitmap(ImageBitmap?)Displays a bitmap in the canvas (https://html.spec.whatwg.org/multipage/canvas.html#dom-imagebitmaprenderingcontext-transferfromimagebitmap): the bitmap is detached (its data is now the bitmap of the canvas), or the canvas is cleared when it is null.

TransferFromImageBitmap(ImageBitmap?)

ImageBitmapRenderingContext.cs

Displays a bitmap in the canvas (https://html.spec.whatwg.org/multipage/canvas.html#dom-imagebitmaprenderingcontext-transferfromimagebitmap): the bitmap is detached (its data is now the bitmap of the canvas), or the canvas is cleared when it is null.

public void TransferFromImageBitmap(ImageBitmap? bitmap)

Parameters

bitmap ImageBitmap?
The bitmap, or null.

Exceptions

DomException
An InvalidStateError when the bitmap is detached.

See also