[]
        
(Showing Draft Content)

Image

Class: Image

Represents a JPEG or PNG image instance.

Extends

Accessors

height

Get Signature

get height(): number;

Gets the height of the image, in pixels.

Returns

number


id

Get Signature

get id(): number;

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


om

Get Signature

get om(): ObjectManager;

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om


opaque

Get Signature

get opaque(): boolean;

Gets the value indicating if the image is opaque.

Returns

boolean


type

Get Signature

get type(): ImageType;

Gets the type of the image, such as JPEG or PNG.

Returns

ImageType


width

Get Signature

get width(): number;

Gets the width of the image, in pixels.

Returns

number

Methods

load()

Call Signature

static load(imageBytes): Image;

Creates an Image from the byte array with JPEG or PNG encoded image data.

Parameters
imageBytes

Uint8Array

The binary data of the image.

Returns

Image

A new instance of the Image.

Call Signature

static load(om, imageBytes): Image;

Creates an Image from the byte array with JPEG or PNG encoded image data.

Parameters
om

ObjectManager

An object manager that controls the lifetime of the Image object.

imageBytes

Uint8Array

The binary data of the image.

Returns

Image

A new instance of the Image.


free()

free(): void;

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


rebind()

rebind(omTo): void;

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind


save()

save(): Uint8Array;

Saves the Image as a byte array with PNG or JPEG-encoded image data.

Returns

Uint8Array

A byte array with image data.


toBitmap()

toBitmap(): Bitmap;

Creates a Bitmap instance from the current Image.

Returns

Bitmap

A new instance of Bitmap with image data.