Do you have a question? Post it now! No Registration Necessary. Now with pictures!
April 3, 2006, 10:36 pm
rate this thread
Could anyone throw some light on the following questions, please?
1) How can I add a hyperlink to an image file generated using GD
For eg., I'm using ImageString(...) function to add text to a JPEG
image. I want to make that text an hyperlink.
2) How do I insert another gif/jpeg image into an image generated using
For eg., I've the following code......I want to include "test.gif" into
the generated JPEG (something like <img src=''> in html)
$c = ImageCreate($cw, $ch);
Re: PHP Image functions -- help
You can't. What you can do is to figure out what area of the image the
text occupies and define that area as a hyperlink using an image map
(image maps are defined in HTML). But you will have to do it OUTSIDE
the script that generates the image.
1. Create a new image with imagecreate().
2. Read the existing gif/jpeg image using imagecreatefromgif()/
3. Copy that image into the one you are working on using
4. Output the new image.
For more information, refer to the PHP Manual:
- » Cannot generate random image for form security - help
- — Previous thread in » PHP Scripting Forum