Skip to content

Function: createImageBitmap() ​

Call Signature ​

ts
function createImageBitmap(image, options?): Promise<ImageBitmap>;

Defined in: types/desktop-engine.d.ts:4947

A bitmap of an image (loaded), a canvas, ImageData, another ImageBitmap or a Blob of an image file (decoded away from the JavaScript thread), as on the web (API 5): all of it, or the rectangle (sx, sy, sw, sh), transparent where it's outside. The promise rejects with an InvalidStateError for an image that hasn't loaded, data that isn't an image or a bitmap larger than 16384 wide or high or than 8192 × 8192 pixels in all, a RangeError for a rectangle of size 0

Parameters ​

ParameterType
image| CanvasDrawable | Blob
options?ImageBitmapOptions

Returns ​

Promise<ImageBitmap>

Call Signature ​

ts
function createImageBitmap(
   image, 
   sx, 
   sy, 
   sw, 
   sh, 
   options?
): Promise<ImageBitmap>;

Defined in: types/desktop-engine.d.ts:4948

A bitmap of an image (loaded), a canvas, ImageData, another ImageBitmap or a Blob of an image file (decoded away from the JavaScript thread), as on the web (API 5): all of it, or the rectangle (sx, sy, sw, sh), transparent where it's outside. The promise rejects with an InvalidStateError for an image that hasn't loaded, data that isn't an image or a bitmap larger than 16384 wide or high or than 8192 × 8192 pixels in all, a RangeError for a rectangle of size 0

Parameters ​

ParameterType
image| CanvasDrawable | Blob
sxnumber
synumber
swnumber
shnumber
options?ImageBitmapOptions

Returns ​

Promise<ImageBitmap>

The SDK is released under the Apache License 2.0