Page 1 of 1

Image help

Posted: Mon Apr 14, 2008 7:21 pm
by Killerkid
Hello everybody,
I'm needing help with GD.

This is what the image looks like but I use "imageCreateFromPNG" It makes the image look bad.
It looks like this.
Anyone know how to fix this,
Thanks.

Re: Image help

Posted: Tue Apr 15, 2008 6:45 pm
by Killerkid
Please?

Re: Image help

Posted: Wed Apr 16, 2008 4:31 am
by markusn00b
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.

Re: Image help

Posted: Wed Apr 16, 2008 4:41 am
by onion2k
That's a 24 bit PNG isn't it? You're doing something that wrecks the alpha channel.

Re: Image help

Posted: Wed Apr 16, 2008 7:50 am
by Killerkid
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);
onion2k wrote:That's a 24 bit PNG isn't it? You're doing something that wrecks the alpha channel.
How would I do that?

Re: Image help

Posted: Tue Apr 29, 2008 11:20 am
by Killerkid
I'm still needing help.