php gd background color


 

php gd background color

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

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

Ads