You are here: Re: Adding a clickable button or text into a image with GD « PHP Programming Language « IT news, forums, messages
Re: Adding a clickable button or text into a image with GD

Posted by Lars Eighner on 10/18/07 14:49

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.

> Thanks
> Chris

><?php
> $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);
> ?>

--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 460 days to go.
What do you do when you're debranded?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация