1/ Create the (background) image in the size and format of your choice.
2/ Modify the code in your banner.php to the following ...
Code: Select all
// Output the header to let the browser know we are
// sending a graphic file format
header("Content-type: image/" . $SITE['format'] );
$im = @imagecreatetruecolor($SITE['image_width'], $SITE['image_height'])
or die("Cannot Initialize new GD image stream");
// Set colors we want to use...
// first background is a white background
$background_color = imagecolorallocate($im, 0xC1, 0xFF, 0xC1);
$black = imagecolorallocate($im, 0x00, 0x00, 0x00);
$green = imagecolorallocate($im, 0x00, 0x80, 0x00);
$blue = imagecolorallocate($im, 0x00, 0x00, 0x99);
$red = imagecolorallocate($im, 0xff, 0x00, 0x00);
$indianred = imagecolorallocate($im, 0x8b, 0x3a, 0x3a);
$baseimg = imagecreatefromjpeg("mybackground.jpg");
imagecopy($im,$baseimg,0,0,0,0,$SITE['image_width'], $SITE['image_height']);
imagedestroy($baseimg);
// Make a Border Around the box
Note the use of .. $im = @imagecreatetruecolor($SITE ...
This is a blank canvass we create to put your background on top. This ensures that if you copy from an image with less than 16mill colours, that all your text colour declarations still give the colours you expect !!