Whitebeam Template Reference Documentation

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 Template Reference Documentation

rb.GraphicImage Object Description
(GraphicImage Template)

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

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

Aggregate Types

rb.GraphicImage.Point Defines a 'point' - either in a polygon or in a drawPixels call
rb.GraphicImage.Rectangle Defines a 'rectangle' for copy operations
rb.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 : 22ms)