<?php
header("Content-type: image/jpg");
function LoadJpeg($imgname)
{
$im = @imagecreatefromjpeg($imgname); /* Attempt to open */
if (!$im) { /* See if it failed */
$im = imagecreate(150, 30); /* Create a blank image */
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
/* Output an errmsg */
imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
}
return $im;
}
$im = @imagecreatetruecolor(600, 400);
$background_color = imagecolorallocate($im, 204, 204, 153);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagefill($im, 600,400, $background_color);
$imjpg = LoadJpeg('../image/topo/153.jpg');
$imjpgx = imagesx($imjpg);
$imjpgy = imagesy($imjpg);
imagecopy ($im,$imjpg, 0,0,0,0,$imjpgx,$imjpgy);
$imjpg = LoadJpeg('../image/topo/16.jpg');
$imjpgx = imagesx($imjpg);
$imjpgy = imagesy($imjpg);
imagecopy ($im,$imjpg, 80,150,0,0,$imjpgx,$imjpgy);
imagestring($im, 5, 50, 50, "Title of the website", $text_color);
imagepng($im);
imagedestroy($im);
?>
My pictures background stays black.
Someone have an idea?