rvalkass 5 Report post Posted July 31, 2006 Basically I have this code: header("Content-type: image/png");$bgimg = "bg.png";$im = imagecreatefrompng($bgimg);$number = rand(10,99);$textcolour = imagecolorallocate($im, 255, 255, 255);$font = "arial.ttf";imagettftext($im, 65, 0, 5, 95, $textcolour, $font, $number);imagepng($im);imagedestroy($im); Unfortunately all I get is the blank placeholder for an image (or the red X if you still use IE) rather than my actual image. I have honed the problem down to the imagettftext line, as I have tried replacing it with imagestring and it works OK. I think the problem is with the font, but I just can't work it out. I know that for this to work you need the GD and FreeType libraries. Last time I checked (ages ago ) Xisto had both these installed. Were the libraries removed, so we are just missing the libraries or have I done something wrong with my code? Any help is greatly appreciated and thanks in advance. Share this post Link to post Share on other sites
electron 0 Report post Posted August 1, 2006 Your GD version might not be supporting imagettftext functionTry the following function:imagestring ( resource image, int font size, int x, int y, string s, int col )This is supported by all versions of GD library.But in this function the text that will be written over the Image will be a little ugly as u cant give the type of Font u want.Hope this helps and have a good day. Share this post Link to post Share on other sites