yekis Posted December 18, 2007 Share Posted December 18, 2007 i get ascii characters when i preview my file in a browser...don't know what's wrong with my code....tnx <?php //define string $font = "ariblk.ttf"; // Defining the background image. $background = imagecreatefrompng("background.png"); // colors to possibly be used later $white = imagecolorallocate($background, 255, 255, 255); $almostWhite = imagecolorallocate( $background, 247, 247, 247 ); // Defining the icons to be added or combined. $insert = imagecreatefrompng("logo.png"); // Get icon width and hight for later use // all icons are the same size $insert_x = imagesx($insert); $insert_y = imagesy($insert); // Combine the images into a single output image. imagecopymerge($background,$insert,426,45,0,0,$insert_x,$insert_y,99); // Add id text imagettftext( $background, 12, 0, 35, 76, $almostWhite, $font, "TEXT"); // Output the results as a png image, to be sent to users browser. imagepng($background); imagedestroy($background); ?> Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted December 18, 2007 Share Posted December 18, 2007 You missed header ("Content-type: image/png"); on the top Quote Link to comment 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.