Bitmap(filename)

new Bitmap(filename)

Load a BMP, TGA or PCX image.
Parameters:
Name Type Description
filename string name of the BMP or PNG file.

Members

static filename

Name of the file.

static height

Height in pixels

static width

Width in pixels

Methods

Draw(x, y)

Draw the image to the canvas at given coordinates.
Parameters:
Name Type Description
x number position to draw to.
y number position to draw to.

DrawTrans(x, y)

Draw the image to the canvas at given coordinates using the alpha channel transparency. Only works for 32bit TGA with alpha channel information.
Parameters:
Name Type Description
x number position to draw to.
y number position to draw to.

GetPixel(x, y) → {number}

Get the color of a pixel of this image.
Parameters:
Name Type Description
x number position.
y number position.
Returns:
number - the color of the pixel.