Image help
Posted: Mon Apr 14, 2008 7:21 pm
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
markusn00b wrote:How is it possible for us to know the problem without seeing the code you use to create the image?!
Post up, with relevant code tags.
Code: Select all
include 'countdown.php';
$count = countdown(4,29,2009);
header("Content-type: image/png");
$string = "Days: " . $count[ 'days' ] . " Hours: " . $count[ 'hours' ] . " Minutes: " . $count[ 'minutes' ] . " Seconds: " . $count[ 'seconds' ] . " to GTA:IV";
$im = imageCreateFromPNG("http://127.0.0.1/smf/pic/gtaiv.png");
$color = imagecolorallocate($im, 0, 0, 0);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagettftext($im,10,0,$px,20,$color,"ARLRDBD.ttf",$string);
imagepng($im);
imagedestroy($im);How would I do that?onion2k wrote:That's a 24 bit PNG isn't it? You're doing something that wrecks the alpha channel.