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

GraphicImage Object Description

The GraphicImage class encapsulates the necessary functionality to build images (GIFs, JPEG and PNG format) 'on the fly'. This functionality is useful in many situations, from the simple example of resizing a big user image to create a thumbnail, to dynamically generating charts.

This class is optionally part of Whitebeam if compiled with the --enable-gd flag (to configure). Switching this flag on links the Whitebeam presentation engine with the 'libgd' image library and to it's dependent libraries.

Methods

GraphicImage.create() Create a new empty image of specified size.
GraphicImage.make() Load an image from a file or from a binary object.
GraphicImage.clean() Delete stored image associated with this GraphicImage
GraphicImage.write() Write an image out to the client browser
GraphicImage.toBinary() Write an image out to an instance of a the Binary class.
GraphicImage.copyRect() Copy a rectangular area from one image to another
GraphicImage.copyRectRotate() Rotate a rectangular area of a source image into a destination image
GraphicImage.colourAlloc() Allocate a colour for use in drawing methods
GraphicImage.colourResolve() Allocate a colour for use in drawing methods
GraphicImage.setPenThickness() Set pen drawing thickness
GraphicImage.setPenStyle() Set pen drawing style
GraphicImage.setClipRegion() Limit drawing functions to a subset of the entire image
GraphicImage.drawPixels() Set the colour for specific pixels within an image
GraphicImage.drawLine() Draw a line between two points
GraphicImage.drawRectangle() Draw a rectangle
GraphicImage.drawPolygon() Draw a polygon
GraphicImage.drawArc() Draw an arc - partial ellipse
GraphicImage.drawText() Draw text into an image
GraphicImage.sharpen() Sharpen a true-colour image
GraphicImage.alphaBlendMode() Set the alpha channel merge mode
GraphicImage.alphaPreserve() Configure how the GraphicImage will serialise alpha channel information on save

Aggregate Types

GraphicImage.Point Defines a 'point' - either in a polygon or in a drawPixels call
GraphicImage.Rectangle Defines a 'rectangle' for copy operations
GraphicImage.Bounds Used to return bounding rectangle for drawText method

Object Properties

Name Type/Value Range/Length Description
widthnumber  Optional, default = null
The width of this image. This property will be 'null' if the object contains no image.
heightnumber  Optional, default = null
The height of this image. This property will be 'null' if the object contains no image.
coloursnumber  Optional, default = null
For palette based images the number of colours used in the palette. 'null' if this object does not contain an image, or the image is true-colour
palettenumber  Optional, default = null
'null' if this object does not contain an image, otherwise returns 'true' if the image is palette based or 'false' if true-colour

Whitebeam release 1.3.36
(loadtime : 34ms)