Home Tutorial Php Phpgd PHP GD Gradient Fill


Share on Google+Share on Google+
PHP GD Gradient Fill
Posted on: November 9, 2009 at 12:00 AM
This example shows how display gradient fill in php gd.


$image = ImageCreate(200, 200);

for($i=0; $i<255; $i++) {

$background_color = ImageColorAllocate($image, $i, $i, $i);


$text_color = ImageColorAllocate($image, 255, 255, 255);

$tekst = "Roseindia";

ImageString($image, 4, 30, 50, "$tekst", $text_color);

header('Content-type: image/png');





After running the program you will get the following output


Related Tags for PHP GD Gradient Fill:

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 9, 2009

Recommend the tutorial

Advertisements Advertisements