Optional
addAdds the listener for the specified event.
The type of event to listen for.
The callback to invoke when the event is fired.
Optional
options: boolean | AddEventListenerOptionsThe options for adding event listener.
The type of event to listen for.
The callback to invoke when the event is fired.
Optional
options: boolean | AddEventListenerOptionsThe options for adding event listener.
Height of the canvas.
Optional
Readonly
parentParent node of the canvas.
Optional
removeRemoves the listener for the specified event.
The type of event to listen for.
The callback to invoke when the event is fired.
Optional
options: boolean | EventListenerOptionsThe options for removing event listener.
The type of event to listen for.
The callback to invoke when the event is fired.
Optional
options: boolean | EventListenerOptionsThe options for removing event listener.
Optional
Readonly
styleStyle of the canvas.
Width of the canvas.
Optional
convertGet the content of the canvas as Blob.
Optional
options: { The options for creating Blob.
Optional
quality?: numberA number between 0 and 1 indicating the image quality to be used when
creating images using file formats that support lossy compression (such as image/jpeg
or image/webp
).
A user agent will use its default quality value if this option is not specified, or if the number
is outside the allowed range.
Optional
type?: stringA string indicating the image format. The default type is image/png
;
that type is also used if the given type isn't supported.
A Promise
returning a Blob object representing the image contained in the canvas.
Dispatches a event.
The Event object to dispatch. Its Event.target property will be set to the current EventTarget.
Returns false if event is cancelable, and at least one of the event handlers which received event called Event.preventDefault(). Otherwise true.
Optional
getGet the position and the size of the canvas.
The smallest rectangle which contains the entire canvas.
Get rendering context of the canvas.
The identifier of the type of context to create.
Optional
options: ICanvasRenderingContext2DSettingsThe options for creating context.
The created context, or null if contextId is not supported.
Optional
options: ImageBitmapRenderingContextSettingsOptional
options: WebGLContextAttributesOptional
options: WebGLContextAttributesOptional
options: ContextSettingsOptional
toCreates a Blob from the content of the canvas.
A callback function with the resulting Blob
object
as a single argument. null
may be passed if the image cannot be created for any reason.
Optional
type: stringA string indicating the image format. The default type is image/png
;
that type is also used if the given type isn't supported.
Optional
quality: numberA number between 0 and 1 indicating the image quality to be used when
creating images using file formats that support lossy compression (such as image/jpeg
or image/webp
).
A user agent will use its default quality value if this option is not specified, or if the number
is outside the allowed range.
Optional
toGet the content of the canvas as data URL.
Optional
type: stringA string indicating the image format. The default type is image/png
;
that type is also used if the given type isn't supported.
Optional
quality: numberA number between 0 and 1 indicating the image quality to be used when
creating images using file formats that support lossy compression (such as image/jpeg
or image/webp
).
A user agent will use its default quality value if this option is not specified, or if the number
is outside the allowed range.
A string containing the requested data URL.
Generated using TypeDoc
Common interface for HTMLCanvasElement, OffscreenCanvas, and other custom canvas classes.
Memberof
PIXI