Whitebeam Object Definition

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Object Definition

Method Description

GraphicImage.create()

Create a new empty image of specified size.

Syntax

GraphicImage = GraphicImage.create(width, height, trueColour)

Parameters

The 'GraphicImage.create' method takes 3 parameters:

Name Type/Value Range/Length Description
widthnumber  Required. Width (in pixels) of new image
heightnumber  Required. Height (in pixels) of new image
trueColourbool  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 'GraphicImage.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);
Whitebeam release 1.3.36
(loadtime : 18ms)