GD fill()
syntax: |
gd.fill(x, y, color) gd.fill(point, color) |
where: |
x - Horizontal position of starting pixel
y - Vertical position of starting pixel
point - Point of starting pixel. See GD getPixel() for a description
color - Fill color index or style
|
return: |
void.
|
description: |
This method is very similar to GD fillToBorder(), except that instead of filling until another color is hit, this method fills all pixels that are the same color as the original, until it hits any other color pixel. The pixels are changed to the color indicated by color.
|
see: |
#link <gd>, GD fillToBorder()
|
example: |
/* Draw a circle with color index 1 and * a smaller one with color * index 3. The call to GD.fill() will fill * the inner circle with color * index 2. The fill will stop at first circle, * since it is not the * same color as the starting pixel. */ 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.fill( [33,34], 2 ); |