Class “ImageBitmap”

Object > ImageBitmap

Represents an in-memory Image. Unlike ImageData it is immutable, but can be created from a number of sources via createImageBitmap.

Type: ImageBitmap extends Object
Constructor: private
Singleton: No
Namespace: tabris
Direct subclasses: None
JSX Support: No

Methods

close()

Disposes the resources associated with this ImageBitmap. Should be called once the image is no longer needed to free up memory.

Returns: undefined

Static Methods

createImageBitmap(imageSource, options?)

Creates a promise that resolves to a new instance of ImageBitmap. Also available in global scope.

Parameter Type Description
imageSource Blob
| ImageData
| ImageBitmap
| Canvas
The data source to create an ImageBitmap instance from.
options {
  resizeWidth: number, // optional
  resizeHeight: number, // optional
  resizeQuality: // Defaults to `'low'`. optional
    'pixelated'
    | 'low'
    | 'medium'
    | 'high'
}
Options for resizing the image. Optional.

Returns: Promise<ImageBitmap>

createImageBitmap(imageSource, sx, sy, sw, sh, options?)

Creates a promise that resolves to a new instance of ImageBitmap. Also available in global scope.

Parameter Type Description
imageSource Blob
| ImageData
| ImageBitmap
| Canvas
The data source to create an ImageBitmap instance from.
sx number The x coordinate of the reference point of the rectangle from which the ImageBitmap will be extracted.
sy number The y coordinate of the reference point of the rectangle from which the ImageBitmap will be extracted.
sw number The width of the rectangle from which the ImageBitmap will be extracted.
sh number The height of the rectangle from which the ImageBitmap will be extracted.
options {
  resizeWidth: number, // optional
  resizeHeight: number, // optional
  resizeQuality: // Defaults to `'low'`. optional
    'pixelated'
    | 'low'
    | 'medium'
    | 'high'
}
Options for resizing the image. Optional.

Returns: Promise<ImageBitmap>

Properties

height

Native image height in pixel

Type: number
Settable: No

width

Native image width in pixel

Type: number
Settable: No