|  | Posted by NC on 04/04/06 01:55 
Hemanth wrote:>
 > Could anyone throw some light on the following questions, please?
 >
 > 1) How can I add a hyperlink to an image file generated using GD
 > library?
 > For eg., I'm using ImageString(...) function to add text to a JPEG
 > image. I want to make that text an hyperlink.
 
 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.
 
 > 2) How do I insert another gif/jpeg image into an image generated
 > using GD library?
 
 1. Create a new image with imagecreate().
 2. Read the existing gif/jpeg image using imagecreatefromgif()/
 imagecreatefromjpeg().
 3. Copy that image into the one you are working on using
 imagecopy().
 4. Output the new image.
 
 For more information, refer to the PHP Manual:
 
 http://www.php.net/imagecreate
 http://www.php.net/imagecreatefromgif
 http://www.php.net/imagecreatefromjpeg
 http://www.php.net/imagecopy
 
 Cheers,
 NC
  Navigation: [Reply to this message] |