Adding a clickable button or text into a image with GD
Adding a clickable button or text into a image with GD
am 18.10.2007 16:39:39 von crazychrisy54
Hi there
I just wondered if there is any way using GD to insert a clickable
button or some clickable text into a image? It is possible to create
images for buttons but what if you want a clickable button *inside*
another image.
I don't know if this is along the right lines but the following code
puts a image inside another image. Perhaps I could then make im2
clickable or is it just not possible? Any help would be very much
appreciated!
Re: Adding a clickable button or text into a image with GD
am 18.10.2007 16:43:50 von luiheidsgoeroe
On Thu, 18 Oct 2007 16:39:39 +0200, wrote:
> Hi there
>
> I just wondered if there is any way using GD to insert a clickable
> button or some clickable text into a image? It is possible to create
> images for buttons but what if you want a clickable button *inside*
> another image.
>
> I don't know if this is along the right lines but the following code
> puts a image inside another image. Perhaps I could then make im2
> clickable or is it just not possible? Any help would be very much
> appreciated!
Please read up on your html. An image will always be just an image. Any =
=
'click'-detection has to come from something else. In html
type=3D"image"> and imagemaps come to mind.
Also, with HTML, it would be a nightmare to maintain/update images with =
=
fixed button images inside on an update. Just use CSS positioning, which=
=
is most userfriendly and portable.
-- =
Rik Wasmus
Re: Adding a clickable button or text into a image with GD
am 18.10.2007 16:49:32 von Lars Eighner
In our last episode,
<1192718379.010409.299430@q5g2000prf.googlegroups.com>,
the lovely and talented crazychrisy54@hotmail.com
broadcast on comp.lang.php:
> Hi there
> I just wondered if there is any way using GD to insert a clickable
> button or some clickable text into a image? It is possible to create
> images for buttons but what if you want a clickable button *inside*
> another image.
> I don't know if this is along the right lines but the following code
> puts a image inside another image. Perhaps I could then make im2
> clickable or is it just not possible? Any help would be very much
> appreciated!
You can make an area of an image clickable with the HTML map element.
The clickability is not in the image. It is in the HTML. You can put stuff
in an image that looks like a button, but that doesn't make it clickable.
You can also make parts of an image clickable without putting anything in
the image that looks like a button.
--
Lars Eighner
Countdown: 460 days to go.
What do you do when you're debranded?
Re: Adding a clickable button or text into a image with GD
am 18.10.2007 19:20:11 von Courtney
crazychrisy54@hotmail.com wrote:
> Hi there
>
> I just wondered if there is any way using GD to insert a clickable
> button or some clickable text into a image? It is possible to create
> images for buttons but what if you want a clickable button *inside*
> another image.
Yup. Its not that hard - there are some ways to do it: Here is mine.
Use a background image in a table cell. Then add clickable text or
another image over the top.
If you specify the table cell size and use non repeating backgrounds of
transperent edged GIFS it needn;t be a reatngular image either.
>
> I don't know if this is along the right lines but the following code
> puts a image inside another image. Perhaps I could then make im2
> clickable or is it just not possible? Any help would be very much
> appreciated!
>
> Thanks
> Chris
>
>
> $im = ImageCreate(800,800);
> $im_color = ImageColorAllocate($im, 0, 255, 0);
>
> $im2 = ImageCreate(200,200);
> $im_color2 = ImageColorAllocate($im2, 255, 0, 0);
>
> // copy image into new resource
> imagecopy($im, $im2, 0, 0, 0, 0, 60, 60 );
>
> header ("Content-type: image/png");
> ImagePNG($im);
> ?>
>