Fill an image with imagefill() in PHP

Description

The following code shows how to fill an image with imagefill().

Example


<?php//from  ww w .  j  a v a2 s .  c o  m
header("Content-type: image/png");
$image = imagecreate( 200, 200 );
$red = imagecolorallocate($image, 255,0,0);
$blue = imagecolorallocate($image, 0,0,255 );
imageline( $image, 0, 0, 199, 199, $blue );
imagefill( $image, 0, 199, $blue );
imagepng($image);
?>

The code above generates the following result.

Fill an image with imagefill() in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text