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); ?> Link to comment https://forums.phpfreaks.com/topic/82144-error-when-i-combine-imagecopymerge-and-imagettftext-functions/ 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 Link to comment https://forums.phpfreaks.com/topic/82144-error-when-i-combine-imagecopymerge-and-imagettftext-functions/#findComment-417443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.