|
Whitebeam Template Reference Documentation
|
GraphicImage Template
create()
Create a new empty image of specified size.
Syntax
GraphicImage = rb.GraphicImage.create(width, height, trueColour)
Parameters
The 'create' method takes 3 parameters:
Name | Type/Value | Range/Length | Description | width | number | | Required. Width (in pixels) of new image | height | number | | Required. Height (in pixels) of new image | trueColour | bool | | Optional, default = true By default new images are created with 24 bit 'true colour' depth. You can
optionally specify 'false' for this parameter to force a 256 colour palette
image |
Results
The 'create' method returns GraphicImage:
Type/Value | Range/Length | Description |
GraphicImage |
  |
Returns a reference to 'this' if the new mage is successfully created, otherwise throws an exception.
|
Remarks This method creates a new empty image. If the new images is a 'true colour' (24bit) image
then the whole of the image is initialsed to black. If it is a palette image then the
first colour allocated with 'colourAlloc' function is deemed to be the background colour.
Where possible it is recommended that images use true-colour, which enables things like
anti-aliasing of text and shapes. Example
// Create a new image - 250 pixels wide, 100 tall using 24 bit colour
var myImage = new GraphicImage;
myImage.create(250,100);
|
|
(loadtime : 19ms) |