Firefox Tomorrow

web api instance property

ImageBitmapRenderingContext: canvas property

View on MDN ↗

Available in workers

The ImageBitmapRenderingContext.canvas property, part of the Canvas API, is a read-only reference to the HTMLCanvasElement or OffscreenCanvas object that is associated with the given context.

Value

A HTMLCanvasElement or OffscreenCanvas object.

Examples

Given this <canvas> element:

<canvas id="canvas"></canvas>

You can get a reference to the canvas element within the ImageBitmapRenderingContext by using the canvas property:

const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("bitmaprenderer");
console.log(ctx.canvas === canvas); // true

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also