GraphicImage Template
clean()
Delete stored image associated with this GraphicImage
Syntax
GraphicImage = rb.GraphicImage.clean()
Parameters
The 'clean' method takes no parameters
Results
The 'clean' method returns GraphicImage:
Type/Value | Range/Length | Description |
GraphicImage |
  |
Returns a reference to 'this' if the operation succeeds, otherwise throws an exception.
|
Remarks Whitebeam takes care to release all image resources at the end of
each page execution. There are times however when manipulating
either a large number of images, or a small number of very large
images, that it can be useful to disard images no longer required. The 'clean' method does just this. Example Load a large image and rotate through 90 degrees before discarding the source image data
var src = new GraphicImage;
src.make('/images/sample.gif','image/gif');
var image_rotated = new GraphicImage;
// Create a canvas in the destination that has the source width
// and height transposed.
image_rotated.create(src.height, src.width);
// Because we want the whole of the source image copied, rotated round the
// centre of the destination image the only parameters we need are the
// destination and the angle.
src.copyRectRotate(image_rotated, 90);
// The source is no longer required - and if the image is big
// the resource used may be significant. Clean now before doing more
// page processing
src.clean();
|