seco Posted April 7, 2008 Share Posted April 7, 2008 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" <?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. Quote Link to comment https://forums.phpfreaks.com/topic/99971-the-image-cannot-be-displayed-because-of-errors/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.