Skip to main content

createImageBitmap

function createImageBitmap
Jump to headingcreateImageBitmap(): Promise<ImageBitmap>

Create a new ImageBitmap object from a given source.

Parameters Jump to heading

The image to create an ImageBitmap from.

The options for creating the ImageBitmap.

Return Type Jump to heading

Promise<ImageBitmap>
Jump to headingcreateImageBitmap(
sx: number,
sy: number,
sw: number,
sh: number,
): Promise<ImageBitmap>

Create a new ImageBitmap object from a given source, cropping to the specified rectangle.

Parameters Jump to heading

The image to create an ImageBitmap from.

The x coordinate of the top-left corner of the sub-rectangle from which the ImageBitmap will be cropped.

The y coordinate of the top-left corner of the sub-rectangle from which the ImageBitmap will be cropped.

The width of the sub-rectangle from which the ImageBitmap will be cropped.

The height of the sub-rectangle from which the ImageBitmap will be cropped.

The options for creating the ImageBitmap.

Return Type Jump to heading

Promise<ImageBitmap>
Back to top