Hi I am getting the hang of this gd - but one little problem remains - how do I assign color to the image so that the background is not black ?
This is the code I have written but I want to change the color of the background ??
<?php
function fromhex($string){
GLOBAL $img1;
sscanf($string, "%2x%2x%2x", $red, $green, $blue);
return ImageColorAllocate($img1,$red,$green,$blue);
}
$img1 = imageCreateTrueColor(120,120);
$background = fromhex('ffffff');
$words = "No Photo";
$font = "/LSANSI.TTF";
imageTTFText($img1, 15, 0,15,60,fromhex('ffffff'),$font, $words);
imageTTFText($img1, 15, 0,35,80,fromhex('ffffff'),$font, "Yet!");
imageFilledRectangle ( $img1, 5, 5, 10, 115,fromhex('33bb99'));
imageFilledRectangle ( $img1, 5, 110, 115,115,fromhex('33bb99'));
imageFilledRectangle ( $img1, 110, 5, 115,115,fromhex('33bb99'));
imageFilledRectangle ( $img1, 5, 5, 115,10,fromhex('33bb99'));
header("Content-type: image/jpeg");
imagejpeg($img1,"./no_image.jpg",100);
imagejpeg($img1,"",100);
imageDestroy($img1);
?>