contents   index   previous   next



GD fillToBorder()

syntax:

gd.fillToBorder(x, y, border, color)

gd.fillToBorder(point, border, color)

where:

x - Horizontal position of starting pixel

 

y - Vertical position of starting pixel

 

point - Point specification of starting pixel.

 

border - Index border color to stop at

 

color - Fill color or style index

 

return:

void.

 

description:

This method fills the image with the selected color, until it hits a border with the color specified by border. border must be a color index, not one of the styled colors. color can be anything.

 

see:

#link <gd>, GD fill()

 

example:

/* Will draw a circle with color index 1,

 * and then fill it with color

 * index 2.  The fill will stop

 * at the specified border, which means that

 * the second circle drawn, using color index 3,

 * will be erased as the

 * outer circle is filled.

 */

var gd = new GD(65, 65);

gd.arc( [32,32], 16, 16, 0, 360, 1 );

gd.arc( [32,32], 14, 14, 0, 360, 3 );

   // will be erased

gd.fillToBorder( [33,34], 1, 2 );

 


GD getInterlaced()