Hi,
After doing the following code I just can´t output any text with "ECHO" or "PRINTF" functions.
I mean. It does all the graphics stuff but it just don´t execute the line "echo "Image 1;"
Can any one help me please???
$pic=imageCreate($boxWidth,$boxHeight);
imageFilledRectangle($pic, $boxLeft+1, $boxTop, $boxRight-1, $boxBottom, imageColorAllocate($pic,$boxGray,$boxGray,$boxGray));
imageFilledRectangle($pic, $boxLeft, $boxTop+1, $boxRight, $boxBottom-1, imageColorAllocate($pic,$boxGray,$boxGray,$boxGray));
Header("Content-type: image/png");
imagePNG($pic);
imageDestroy($pic);
echo "IMAGE 1";
Images and text
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you want to add text to an image:
http://www.php.net/manual/en/function.imagettftext.php
http://www.php.net/manual/en/function.imagefttext.php
Mac
http://www.php.net/manual/en/function.imagettftext.php
http://www.php.net/manual/en/function.imagefttext.php
Mac
- Luis Almeida
- Forum Commoner
- Posts: 33
- Joined: Tue Apr 01, 2003 4:22 am
- ILoveJackDaniels
- Forum Commoner
- Posts: 43
- Joined: Mon May 20, 2002 8:18 am
- Location: Brighton, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
As ILoveJackDaniels said, you can't tell the browser you want to display an image and then expect it to be able to deal with text as well. If you want to add text you can either put the text on the image or, if for instance the image creation script was in a file called imagecreate.php, you could do:
Mac
Code: Select all
<img src="imagecreate.php" alt="PHP generated image" />
<p>Image 1</p>- Luis Almeida
- Forum Commoner
- Posts: 33
- Joined: Tue Apr 01, 2003 4:22 am
Thanks
Thank you for concerning
that worked just fine
that worked just fine