the image cannot be displayed because of errors
Posted: Mon Apr 07, 2008 10:02 pm
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi
i try the following code to write a text on image and it gives me error says: "the image cannot be displayed because of errors"
any idea where is the wrong?
im using wamp when i try other server it gives me the error at line 2 the header() line
any help?
thanks in advance.
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi
i try the following code to write a text on image and it gives me error says: "the image cannot be displayed because of errors"
Code: Select all
<?php
header("Content-type: image/png");
$im = imagecreatetruecolor(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text = 'www';
$font = 'arial.TTF';
imagettftext($im, 20, 0, 10, 20, $black, $font,$text);
imagepng($im);
?>any idea where is the wrong?
im using wamp when i try other server it gives me the error at line 2 the header() line
any help?
thanks in advance.
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: