473,326 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

PHP Image functions -- help

Hello,

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.

2) How do I insert another gif/jpeg image into an image generated using
GD library?
For eg., I've the following code......I want to include "test.gif" into
the generated JPEG (something like <img src=''> in html)

header("Content-Type: image/jpeg");
$c = ImageCreate($cw, $ch);
:
:
ImageFilledRectangle(....)
ImageRectangle(....)
ImageString(....)
:
:
ImageJPEG($c);
TIA,
Hemanth

Apr 3 '06 #1
1 2811
NC
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

Apr 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Useko Netsumi | last post by:
Hi, suppose I'd like to convert my JPG images(in a directory) into a lower resolution and uniform size(while maintaining its aspect ratio), I would I do that in PHP? I've seen code with PHP/GD...
5
by: news | last post by:
Hi, I am pretty new to PHP I want to do the following but I have been unable to find good info/ or sample code on it; please help; - retrieve a gif/jpeg image using PHP from another site -...
9
by: Chris Jankowski | last post by:
Hi all, I am still new to using Python, so bare with me. I am trying to call a DLL from my program to use some of it's functions. The only parameter is supposed to be a pointer to an image. I...
8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
2
by: cjl | last post by:
Hey all: I have a div of a known size, 672px X 672px. In it I will display images that are of unknown size. I have two simple functions that shrink and center the image: function shrink() {...
6
by: QuasiChameleon | last post by:
Hi, I'm trying to create a grayscale image class that reads and writes grayscale Targa format. This works well with smaller images, but corrupts larger images and creates a "Segmentation fault...
0
by: Crystal | last post by:
I have created a small program that prints out an organization chart in PHP using the GD lib's imagecreate, imageline and imagestring functions. Basically, a user selects an employee from a...
8
by: ctiggerf | last post by:
I was hopeing someone could help me out here. Been stumped on this one all day. This function 1. Checks uploaded files. 2. Creates two resized images from each (a full size, and a...
12
by: laredotornado | last post by:
Hi, I'm using PHP 5. I was wondering given an image, a.jpg, how can I make an image that would look like you slid a white index card (which I have a file, white.jpg with the same dimensions as...
36
by: vimal3271 | last post by:
I want to know how to read image files in C.. what are the headers that i should include? is there any tutorials regarding this ? pls inform me.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.