|
|
|
|
![]() ![]() |
Jul 31 2006, 06:42 PM
Post
#1
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,111 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
Basically I have this code:
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 Any help is greatly appreciated and thanks in advance. |
|
|
|
Aug 1 2006, 04:10 AM
Post
#2
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 162 Joined: 10-May 06 Member No.: 23,375 |
Your GD version might not be supporting imagettftext function
Try 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. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 5th September 2008 - 11:51 PM |