The imagefill() function is used to fill the image.
Syntax
imagefill(img, x, y, color)
Parameters
img
Create a blank image with imagecreatetruecolor().x
x-coordinate of start pointy
y-coordinate of start pointcolor
The fill color.
Return
The imagefill() function returns TRUE on success or FALSE on failure.
Example
The following is an example:
<?php $img = imagecreatetruecolor(400, 400); $color = imagecolorallocate($img, 190, 255, 120); imagefill($img, 0, 0, $color); header('Content-type: image/png'); imagepng($img); imagedestroy($img); ?>
Output
The following is the output: