the desired width of the canvas
the desired height of the canvas
The attributes to create both the canvas and context
Whether to enable anti-aliasing, use false (default) for a pixelated effect.
the context type to be created ("2d", "webgl", "webgl2")
will create an offscreenCanvas if true instead of a standard canvas
Indicates whether or not a lot of read-back operations are planned
the rendering context of this CanvasRenderTarget
The height of this canvas texture in pixels
The width of this canvas texture in pixels
Returns an ImageData object representing the underlying pixel data for a specified portion of this canvas texture.
(Note: when using getImageData(), it is highly recommended to use the willReadFrequently
attribute when creatimg the corresponding canvas texture)
The x-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted
The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted
The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left
The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up
The ImageData extracted from this CanvasRenderTarget.
invalidate the current CanvasRenderTarget, and force a reupload of the corresponding texture (call this if you modify the canvas content between two draw calls)
the renderer to which this canvas texture is attached
creates a Blob object representing the image contained in this canvas texture
Optional
type: string = "image/png"A string indicating the image format
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 Promise returning a Blob object representing the image contained in this canvas texture
returns a data URL containing a representation of the most recently rendered image of this canvas texture (not supported by OffscreenCanvas)
Optional
type: string = "image/png"A string indicating the image format
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 Promise returning a string containing the requested data URL.
creates an ImageBitmap object from the most recently rendered image of this canvas texture
Optional
type: string = "image/png"A string indicating the image format
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 Promise returning an ImageBitmap.
Deprecated
since 17.1.0
See
CanvasRenderTarget