Developer Resources
Bitmap
Overview
The Bitmap class encapsulates a bitmap.
Constructor
- Bitmap(width : Integer, height : Integer)
- Bitmap(xpm : String, type : Integer)
Arguments
- width
- The width of the created bitmap.
- height
- The height of the created bitmap.
- xpm
- The xpm data to use in creating the bitmap object.
- type
- The type of data being used as input.
Properties
- Bitmap.FormatBMP
- A type flag representing the Windows BMP file format.
- Bitmap.FormatGIF
- A type flag representing the GIF file format.
- Bitmap.FormatXPM
- A type flag representing the X Pixmap file format.
- Bitmap.FormatPNG
- A type flag representing the PNG file format.
- Bitmap.FormatJPG
- A type flag representing the JPG file format.
Methods
- Bitmap.getHeight
- Gets the height of the bitmap.
- Bitmap.getWidth
- Gets the width of the bitmap.
- Bitmap.isOk
- Indicates whether or not the Bitmap object represents a valid bitmap.
- Bitmap.loadFile
- Loads a file into a bitmap object.
- Bitmap.saveFile
- Saves bitmap object to a file
- Bitmap.setHeight
- Sets the height of the bitmap.
- Bitmap.setWidth
- Sets the width of the bitmap.
Bitmap.getHeight
- function Bitmap.getHeight() : Integer
Returns
Returns the height of the bitmap.
Description
Returns the height of the bitmap.
Bitmap.getWidth
- function Bitmap.getWidth() : Integer
Returns
Returns the width of the bitmap.
Description
Returns the width of the bitmap.
Bitmap.isOk
- function Bitmap.isOk() : Boolean
Returns
Returns true if the Bitmap object represents a valid bitmap, and false otherwise.
Description
Returns true if the Bitmap object represents a valid bitmap. Returns false if the Bitmap object does not represent a valid bitmap.
Bitmap.loadFile
- function Bitmap.loadFile(filename : String, type : Integer) : Boolean
Arguments
- filename
- The name of the file to load.
- type
- An optional parameter specifying the format to use when loading the data from the file.
Returns
Returns true if the bitmap is successfully loaded from the file and false otherwise.
Description
Loads a bitmap from a file, where the file is specified filename and the optional file format is given by type. The type is one of Bitmap.FormatBMP, Bitmap.FormatGIF, Bitmap.FormatXPM, Bitmap.FormatPNG, or Bitmap.FormatJPG. Returns true if the bitmap is successfully loaded from the file and false otherwise.
Bitmap.saveFile
- function Bitmap.saveFile(filename : String, type : Integer) : Boolean
Arguments
- filename
- The name of the file to save.
- type
- An optional parameter specifying the format to use when saving the data to the file.
Returns
Returns true if the bitmap is successfully saved to the file and false otherwise.
Description
Saves a bitmap to a file, where the file is specified filename and the optional file format is given by type. The type is one of Bitmap.FormatBMP, Bitmap.FormatGIF, Bitmap.FormatXPM, Bitmap.FormatPNG, or Bitmap.FormatJPG. Returns true if the bitmap is successfully saved to the file and false otherwise.
Bitmap.setHeight
- function Bitmap.setHeight(height : Integer)
Arguments
- height
- The height to which to set the bitmap.
Description
Sets the height of the bitmap.
Bitmap.setWidth
- function Bitmap.setWidth(width : Integer)
Arguments
- width
- The width to which to set the bitmap.
Description
Sets the width of the bitmap.