Styles, Tiles & Brushes

 

You aren't limited to drawing shapes with a single pixel line, or filling areas with one flat color; the GD library provides several functions that can alter the default behavior of the drawing and filling functions.
void imageSetThickness ( resource image, int thickness)
Sets the thickness of the lines drawn when drawing rectangles, polygons, ellipses etc. etc. to thickness pixels.
($im,  ) ;

Unlike the following functions that are only applied in conjunction with the use of special color constants, imageSetThickness()  is a global property and effects every drawing function after it is called.
int imageSetStyle ( resource image, array style)
Sets the style to be used by all line drawing functions when drawing with the special color IMG_COLOR_STYLED. The style parameter is an array of pixels.
$style = array ( ,,,,,,,,, );

imageSetStyle($im, $style) ;

The next two functions load existing images and use them to create styles. These are the original images provided as options in the examples:
checkerboard red dot rainbow NYPHP
int imageSetTile  ( resource image, resource tile )
Sets the tile image to be used by all region filling functions when filling with the special color IMG_COLOR_TILED. A tile is an image used to fill an area with a repeated pattern. Any GD image can be used as a tile.
imageSetTile ( $im, ) ;

int imageSetBrush  ( resource image, resource brush )
Sets the brush image to be used by all line drawing functions when drawing with the special colors IMG_COLOR_BRUSHED or IMG_COLOR_STYLEDBRUSHED.
imageSetBrush ( $im, ) ;