Definition
HTML Standard defines HTMLCanvasElement
[Exposed=Window]
interface HTMLCanvasElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions] attribute unsigned long width;
[CEReactions] attribute unsigned long height;
RenderingContext? getContext(DOMString contextId, optional any options = null);
USVString toDataURL(optional DOMString type = "image/png", optional any quality);
undefined toBlob(BlobCallback _callback, optional DOMString type = "image/png", optional any quality);
OffscreenCanvas transferControlToOffscreen();
};
This interface is extended in the following specifications:
- Media Capture from DOM Elements
partial interface HTMLCanvasElement { MediaStream captureStream (optional double frameRequestRate); };
Consolidated IDL (across mixin and partials)
[Exposed=Window]
interface HTMLCanvasElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions] attribute unsigned long width;
[CEReactions] attribute unsigned long height;
RenderingContext? getContext(DOMString contextId, optional any options = null);
USVString toDataURL(optional DOMString type = "image/png", optional any quality);
undefined toBlob(BlobCallback _callback, optional DOMString type = "image/png", optional any quality);
OffscreenCanvas transferControlToOffscreen();
MediaStream captureStream (optional double frameRequestRate);
};
Methods and attributes that return objects implementing HTMLCanvasElement
Referring IDL interfaces/dictionaries
Referring specifications
- WebGL Specification refers to
HTMLCanvasElement
- Media Capture from DOM Elements refers to
HTMLCanvasElement
- WebGPU refers to
HTMLCanvasElement