|
-
Jul 4th, 2005, 02:05 AM
#1
Thread Starter
Member
[RESOLVED]Text over picture problem
I have been working on a script with some help. What I am trying to do is have 2 seperate values and post them in exact coords on an image. Like a watermark but in text. Here is what I have so far but I dont get any errors just a red X. Any help is appricated
PHP Code:
<?
header('Content-Type: image/jpeg');
$text1 = "12";
$text2 = "43";
$image = imagecreatefromjpeg("water.jpg"); //read the image into memory for editing...
$white = imagecolorallocate($image,255,255,255); //php.net/imagecolorallocate
imagettftext($image,5, 0, 20, 20, $white, "../gillsans.ttf", $text1); //string 1
imagettftext($image,5, 0, 20, 50, $white, "../gillsans.ttf", $text2); //string 2
imagejpeg($image,'',60); //This outputs to browser....
imagedestroy($image); //Remove image from memory
?>
The image I am using is here:
http://65.69.189.225/ftp/CoZ/pappy/water.jpg
and the page i have the script on is here
http://65.69.189.225/ftp/CoZ/pappy/new.php
Thank you,
PaPPy
Last edited by PaPPy; Jul 4th, 2005 at 04:13 PM.
-
Jul 4th, 2005, 12:27 PM
#2
Fanatic Member
Re: Text over picture problem
you made one simple mistake!!!
PHP Code:
imagettftext($image,5, 0, 20, 20, $white, "../gillsans.ttf", $text1); //string 1
imagettftext($image,5, 0, 20, 50, $white, "../gillsans.ttf", $text2); //string 2
should be...
PHP Code:
imagettftext($image,5, 0, 20, 20, $white, "gillsans.ttf", $text1); //string 1
imagettftext($image,5, 0, 20, 50, $white, "gillsans.ttf", $text2); //string 2
you are telling it to go 2 directories up to find the font, but that is not where the font is stored.
this is what that code will look like:
http://www.tkforums.com/new.php
-
Jul 4th, 2005, 04:12 PM
#3
Thread Starter
Member
Re: Text over picture problem
 Originally Posted by ALL
you made one simple mistake!!!
PHP Code:
imagettftext($image,5, 0, 20, 20, $white, "../gillsans.ttf", $text1); //string 1
imagettftext($image,5, 0, 20, 50, $white, "../gillsans.ttf", $text2); //string 2
should be...
PHP Code:
imagettftext($image,5, 0, 20, 20, $white, "gillsans.ttf", $text1); //string 1
imagettftext($image,5, 0, 20, 50, $white, "gillsans.ttf", $text2); //string 2
you are telling it to go 2 directories up to find the font, but that is not where the font is stored.
this is what that code will look like:
http://www.tkforums.com/new.php
that is so strange cause i tried that before but i tried it again and it works!
-
Jul 5th, 2005, 09:20 AM
#4
Fanatic Member
Re: [RESOLVED]Text over picture problem
ya, i hate it when that stuff happens too!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|