You are here: imagettftext problem « PHP Programming Language « IT news, forums, messages
imagettftext problem

Posted by monomaniac21 on 05/17/06 00:41

My url is www.aptitudehack.com

Hi i cant get an image to display on another server though it does on
mine. Here is the code for the page. The problem i think is the
imagettftext function particularly the reference to my font file
"Verdana". If i use a different function to write text it does so no
bother but unfortunately i need this function to work. Here is the
error it outputs followed by the code for the page in question:


The image "http://www.aptitudehack.com/imagepage.php" cannot be
displayed, because it contains errors.


<?php

// Define .PNG image
header("Content-type: image/png");
$imgWidth=575;
$imgHeight=175;

// Create image and define colors
$image=imagecreate($imgWidth, $imgHeight);
$colorWhite=imagecolorallocate($image, 255, 255, 255);
$colorRed=imagecolorallocate($image, 255, 0, 0);

//label y axis
imagettftext($image, 7, 0, 22, 110, $colorRed, 'Verdana', 'results');
//this should output the word results

// Output graph and clear image from memory
imagepng($image);
imagedestroy($image);
?>

//the font file is definitely in the same directory

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация