The height of the offscreen canvas.
Promise<number>
The width of the offscreen canvas.
Promise<number>
Creates a Blob
object representing the image contained in the canvas.
ImageEncodeOptions
. You can specify several options when converting your OffscreenCanvas
object into a Blob
object, for example:
const blob = offscreenCanvas.convertToBlob({ type: "image/jpeg", quality: 0.95 });
options:
type
**: A `string` indicating the image format. The default type is image/png
.**quality**
: A `number` between 0
and 1
indicating image quality if the type
option is image/jpeg
or image/webp
. If this argument is anything else, the default value for image quality is used. Other arguments are ignored.Promise<Blob>
Creates an ImageBitmap
object from the most recently rendered image of the OffscreenCanvas
.
ImageBitmap
getContext() | addEventListener() |
dispatchEvent() | removeEventListener() |