Using the "Image" Class
<< previous | Chapter 6. Graphics and Sound | next >>

## Using the "Image" Class

Once an image file has been loaded into an Image object (as described in the section called “Loading Image Files”), the image data can be accessed and manipulated directly via methods in the class Image.tz.

The Image class method set-pixel (and related methods for setting red, green, blue and alpha pixel values individually) can be used to modify an image dynamically. This will dynamically alter the appearence of any objects using the image as a texture, bitmap or lightmap. The demo "DynamicTexture" shows an example of how image textures can be dynamically modified.

The Image class method get-pixel (and related methods for getting red, green, blue and alpha pixel values individually) can be used to read individual pixel data from an Image. This allows the image data to be used as simulation input. The demo "Painter" shows an example of how an Image file can be used as input data for a simulation.

<< previous | Up | next >>
Displaying Objects as "Lightmaps" | Table of Contents | Custom Drawings with the "Drawing" Class