Share on Google+Share on Google+

php gd background color

Ads
This example shows you how to create background color in php gd.

<?php

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

$width = 350;

$height = 360;

$im = ImageCreateTrueColor($width, $height);

$red = ImageColorAllocate($im, 255, 0, 0);

ImageFillToBorder($im, 0, 0, $red, $red);

ImagePNG($im);

ImageDestroy($im);

 

After running the program you will get the following output

Advertisements

Ads

Posted on: October 31, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial 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.

Advertisement