Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, does anyone know if there is

Status
Not open for further replies.

sineados

Programmer
Oct 17, 2001
34
IE
Hi,

does anyone know if there is a way of dynamically changing the text on a gif file. This is the code I have which has text on the graphic. I don't want to hardcode the text though.

<!--webbot bot=&quot;ImageMap&quot;
text=&quot; (286,31) (404, 161) {Solution
Product
Description
Version
Release Date
Version
} {Times New Roman} 12 B #000600 CT 0 &quot; SRC=&quot;images/discface.gif&quot;
ALT=&quot;Org Chart&quot; BORDER=&quot;0&quot; width=&quot;720&quot; height=&quot;540&quot; -->

Basically the Solution, Product, Description etc would contain actual values.

I have tried putting the above in asp but it didn't work.

I wonder can it be done?

thanks
Sinead
 
Images, specifically GIF's, are mathematical representations of the image. You can't alter the image dynamically to add text, etc. to it unless you can decode the image which, although possible, just isn't practical for a web page. Best bet is to place the images in a table structure and dynamically add/alter the text in the cell below the images. You can, of course, resort to a java applet but if you have more than 3 or 4 images per page, you'll likely halt the user's computer or at least stop the browser from operating. Besides, you'd have to be pretty fluent in writing Java applet routines to accomplish this. There's always a better way...
 
You could always try designing another gif that actually says what you want the image to say when the user moves over it or clicks with a pretty small code. All you need to do is:
========================================================
<img src=&quot;Pics.gif&quot; alt=&quot;Click&quot; width=&quot;80&quot; height=&quot;12&quot; class=&quot;noprint&quot; border=0&quot;
onmouseover=&quot;this.src='Pics2.gif'&quot;
onmouseout=&quot;this.src='Pics.gif'&quot; /></a>
=========================================================
See that? This how it works:
1. Pics.gif is the original pic.
2. Pics2.gif is what your original will change to on mouse over.
3. Pics.gif again is the original and this is what it will return to once mouse over is mouse out.
---------------------------------------------------------
As you can see my friend it is real simple to grasp, just make a picture the way you want, and then make a copy of the one you first made and add to it the text or color that you want it to change to. Real simple.

Hope this helps!

Code One

P.s. this question should have been in dhtml. ;p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top