search for in the  
<imageellipseimagefilledarc>
Last updated: Thu, 19 May 2005

imagefill

(PHP 3, PHP 4, PHP 5)

imagefill -- Flood fill

Description

int imagefill ( resource image, int x, int y, int color )

imagefill() performs a flood fill starting at coordinate x, y (top left is 0, 0) with color color in the image image.



User Contributed Notes
imagefill
glimpse at glimpse-fr dot org
25-Apr-2005 08:42
In response to philip at fcknet dot dk :

It depends on the version of PHP. In some 4.3 releases (but I'm not sure to know the exact version number), you must use the tips given by latortugamorada at yahoo dot com :
"you have to use imagecreate and fill it and then imagecopy that onto the imagecreatetruecolor..."

Thank you very much, latortugamorada at yahoo dot com!
philip at fcknet dot dk
28-Feb-2005 10:31
In response to latortugamorada at yahoo dot com at  21-Jan-2005 07:56.

Imagefill works fine with imagecreatetruecolor. I tested on both Windows XP Home (PHP 5.0.3, Apache 2.x), and FreeBSD v. somethin PHP 5.0.3. Both worked absolutely fine.
latortugamorada at yahoo dot com
21-Jan-2005 12:56
Hey, um, this imagefill stuff doesn't work with imagecreatetruecolor.  you have to use imagecreate and fill it and then imagecopy that onto the imagecreatetruecolor... if that makes any sense.
rev at return to the pit dot com
24-Mar-2004 03:01
since it's not spoke of what int color is...
here's what I finally figured out:

it's a reference to a loaded color.

/start code:
$im = ImageCreateFromJPEG("us_map_regions.jpg");
$red = 225;
$green = 0;
$blue = 255;
$color = ImageColorAllocate( $im, $red, $green, $blue );
$x = 100;
$y = 100;
imagefill($im, $x,$y, $color);
header("Content-type: image/jpeg");
Imagejpeg($im,"",100);
ImageDestroy($im);
/end code
and "bang" there you go.. a nicely lavender filled area.
enjoy.
Igor Garcia
28-Jun-2003 05:18
This function, cannot deal with transparencies.
So you need to use imagecolorallocate instead of imagecolorallocatealpha.
Thus, be careful with color variables that allready set with imageallocatecoloralpha because this can slow-down or hang-up your system.
norxh
04-Jun-2003 10:36
For new images, you must allocate a color before this function will work.
08-Feb-2003 07:49
Actually, it can handle pre-transparent images. To remove it you need to do something like:
   imagecolortransparent($img, 0);
to null out the previous transparency colors. ;)
aqmprod at iname dot com
09-Jan-2000 07:08
This function does not seem to work with images already been transparent. If you fill at x=0, y=0, and there are still transparent parts that you did
not reach with your fill, they change to a different color.

The ImageColorSet function seems to be the solution, but i can't work with transparancy.

<imageellipseimagefilledarc>
 Last updated: Thu, 19 May 2005
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: The Server Pages
Last updated: Thu May 19 17:35:34 2005 CDT