Bridge2021
Object

BitmapData

Represents an image as a matrix of pixell.

Properties

NameType AccessDescription
Number readonly
Number readonly A 32-bit Adler checksum of the image data.
Number readonly
Number readonly Image height in pixels.
Number readonly A pointer to the buffer storing the matrix of pixels.
Array readonly The rectangle that defines the size of the bitmap image, in the format [0, 0, w, h]. Origin is top left.
Number readonly The length in bytes of a row of pixels.
Boolean readonly True if the bitmap image supports per-pixel transparency.
Number readonly Image width in pixels.

Methods

BitmapData

Duplicates this object, creating a new object with an exact copy of the contained bitmap.

void

Explicitly frees the memory used to store pixel data for this object.

void

Writes the image data to a file in JPEG format.

dest File A File object or a string containing the platform-specific path and filename for the target file.
jpegQuality? Number The quality of the image.
Number

Retrieves the color data for a specific pixel from the image.

x Number The horizontal coordinate of the pixel, relative to the bitmap's origin, the top left.
y Number The vertical coordinate of the pixel, relative to the bitmap's origin, the top left.
Number

Retrieves the color data for a specific pixel from the image, including its alpha channel.

x Number The horizontal coordinate of the pixel, relative to the bitmap's origin, the top left.
y Number The vertical coordinate of the pixel, relative to the bitmap's origin, the top left.
void

Loads the JPEG stream at a memory address into this object, replacing the previous content.

data Number The address of the data stream.
dataSize Number The length of the data buffer in bytes.
void

Loads the PNG stream at a memory address into this object, replacing the previous content.

data Number The address of the data stream.
dataSize Number The length of the data buffer in bytes.
BitmapData

Resizes the bitmap to the specified dimensions.

dimensions Number The desired edge size, in pixels, of the resized image.
quality? String The algorithm to use in scaling, which trades off image quality and execution time.
BitmapData

Rotates the bitmap by the specified multiple of 90 degrees.

angle Number The rotation angle in degrees.
void

Sets the color data for a specific pixel from the image.

x Number The horizontal coordinate of the pixel, relative to the bitmap's origin, the top left.
y Number The vertical coordinate of the pixel, relative to the bitmap's origin, the top left.
color Object The color.
void

Sets the color data for a specific pixel from the image, including its alpha channel.

x Number The horizontal coordinate of the pixel, relative to the bitmap's origin, the top left.
y Number The vertical coordinate of the pixel, relative to the bitmap's origin, the top left.
color Object The color.

Return 3

Methods that return a BitmapData.