contents   index   previous   next



GD setTile()

syntax:

gd.setTile(tile)

where:

tile - A GD image to use as the repeating tile for this image

 

return:

void.

 

description:

This method sets the current tile for this image in a manner similar to GD setBrush(). This tile image is then used whenever the style "tiled" is used as a color parameter in a function. The "tiled" style only works when calling a filling function, such as GD fill() or GD filledPolygon(). This method attempts to preserve the colors of the original tile, by finding exact colors, allocating new colors, or finding the closest color if necessary. Transparent pixels in the image allow the underlying image to shown through. Once the tile is set with setTile(), the original tile must be retained as long as the image is being used. Otherwise, the result is undefined.

 

see:

#link <gd>, GD setBrush()

 

example:

var tile = GD.fromGif("tile.gif");

var gd = new GD(64,64);

gd.setTile( tile );

gd.filledRectangle( [0,0], [63,63], "tiled" );

tile.destroy();

 


GD string()