Reply
how to scale imagemaps?
Old 08-02-2004, 01:35 AM how to scale imagemaps?
Novice Talker

Posts: 5
forgive my bumbling but im still a bit of a newbie.is there any way to have a relative scaling of imagemap coordinates? they must be polygonal (er however you spell it) so any substitute that creates rectangular hot spots wont do.anyone now how this can be done?
buckky is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-02-2004, 07:07 PM
theJack's Avatar
Experienced Talker

Posts: 46
Nope. There's no way to scale an image map that way.
__________________
-theJack
theJack is offline
Reply With Quote
View Public Profile Visit theJack's homepage!
 
Old 08-03-2004, 08:35 AM
Novice Talker

Posts: 5
is there no method of achieving this?any kind of scripting/hack or incantation? REALLY?i dont want to think such a simple function is just not possible at all.would that not be sad? it is not written in stone that it must be an imagemap, but i dont know how else to make irregular shaped hot spots.. im holding on to my hope.

Last edited by buckky : 08-03-2004 at 08:41 AM.
buckky is offline
Reply With Quote
View Public Profile
 
Old 08-03-2004, 09:45 AM
witchblade32's Avatar
Super Talker

Posts: 140
Location: Lititz, PA
I don't understand what you mean by scaling.

Photoshop/imageready, fireworks and a number of others, including lowcost or freeware image map programs I'm sure can generate image map code for you using polygonals if you start with a correct sized image for your needs.
__________________
When you eliminate all other possibilities, what remains, no matter how improbable, is the answer.
witchblade32 is offline
Reply With Quote
View Public Profile Visit witchblade32's homepage!
 
Old 08-03-2004, 10:37 AM hi
Mooofasa's Avatar
Defies a Status

Posts: 1,612
Name: Michael (mik) Land
Location: England
Im not too sure on this scaling niether, anyway, have you tried looking around on tutoial sites?

www.w3schools.com
__________________
Tumblings.co.uk - Tumblog with thoughts, quotes, links, videos, images and my creations.
Opera Browser - The best free web browser.
Opera Dev Tools - Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 08-03-2004, 10:51 PM
Novice Talker

Posts: 5
what i mean (and need) is to be able to have the absolute coordinates of an imagemap rendered in the browser of the visitor as relative,so that as the image "behind" the map is scaled(and stretched) to fit browser window, so too would be the imagemap. the goal is tho have the hotspots (link area)overlay the image in the same way,no matter what size the images is rescaled to(client side).in other words if i have a polygonal hot spot over someones hand in an image,and i have the image set to be whatever percent of the browser window,then the hotspot also re scales so that it is always covering the hand. thus far when i attempt this the coordinates of my imagemaps remain absolute,therefore dont match up with the relatively sized images.ill check out the apps recomended above to see if this can be done with them but i would prefer to be able to do this by hand.again any method that achieves this effect would be welcome. and yes this isnt the only place im asking this question,and when i do learn what works i will post here. i can give an example (that doesnt work,obviously)if this is still not clear.

Last edited by buckky : 08-03-2004 at 10:55 PM.
buckky is offline
Reply With Quote
View Public Profile
 
Old 08-05-2004, 11:06 PM
Novice Talker

Posts: 5
well I suppose its nearly a matter of changing the numbers on the code.
If you're reducing the area of the imagemap by 50%, then divide all coordinates by root 2, and if its a reduction of 25%, divide by 2. If it's an imagemap with a LOT of numbers to change, then maybe you're out of luck...
...unless you have a calculator handy.

EDIT: After more carefully reviewing the last post, My answer still remains "maybe you're out of luck..."

Last edited by Chrisknyfe : 08-05-2004 at 11:10 PM. Reason: I didn't read the whole of the last post.
Chrisknyfe is offline
Reply With Quote
View Public Profile
 
Old 08-06-2004, 06:17 AM
Novice Talker

Posts: 5
thank you everyone for responding..i possibly found what im looking for(someone else did really). if i needed to rescale any image map just once i can do that with my eyes closed(well almost closed) i needed something to dynamically scale the map as each time the viewing area changes in any way.i havent tried it yet as i just got the news but i belive here is what i was looking for.but i wont know untill i try to use it if this is exatly the fix i seek. im not sure yet if i can get relative scaling out of the following example but its all ive got so far. i think ill still need some help,so stick around but here is what im starting with,and its enough to give me hope (note i dont want to use the zoom function instead i want percent of display area scaling)
NOTE -this is from http://www.siteexperts.com/dhtml/ch9/chapter/part4.asp
<HTML>
<HEAD>
<TITLE>Dynamically Scaling Image Maps</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function getMap(elImage) {
// Be sure that a map is specified for the image.
if (null != elImage.useMap) {
// Remove the leading # from the bookmark.
var strMap = elImage.useMap.substring(1);
// Return the element with the specified name.
return document.all[strMap];
}
else
return null;
}

function zoomImage(elImage, amount) {
// Expand the image the specified amount.
var elMap = getMap(elImage);
elImage.width *= amount;
elImage.height *= amount;
// If an image map is available, scale it too.
if (null != elMap) {
for (var intLoop = 0; intLoop < elMap.areas.length;
intLoop++) {
var elArea = elMap.areas[intLoop];
// Break the coordinates string into an array.
var coords = elArea.coords.split(",");
var scaledCoords = "";
// Rebuild the new scaled string.
for (coord in coords) {
scaledCoords += (coords[coord] * amount) + ",";
}

// Put the scaled coordinates back into the map.
elArea.coords = scaledCoords;
}
}
}

function swapButtons(b1, b2) {
// Swap the enabled/disabled buttons.
document.all[b1].disabled = true;
document.all[b2].disabled = false;
}
</SCRIPT>
</HEAD>
<BODY>
<P>
<INPUT TYPE=BUTTON VALUE="Zoom In"
ONCLICK="zoomImage(document.all.img1, 2);
swapButtons(`zoomin', 'zoomout');"
ID="zoomin">
<INPUT TYPE=BUTTON VALUE="Zoom Out"
ONCLICK="zoomImage(document.all.img1, .5);
swapButtons(`zoomout', 'zoomin');"
ID="zoomout" DISABLED>
</P>
<P>
<IMG SRC="img001.gif" WIDTH=200 HEIGHT=200
ID="img1" USEMAP="#map1">
<MAP NAME="map1">
<AREA SHAPE="POLYGON"
COORDS="92, 140, 126, 114, 155, 139, 124, 163"
HREF="home.htm">
<AREA SHAPE="CIRCLE" COORDS="30, 105, 30" HREF="cool.htm">
<AREA SHAPE="RECT" COORDS="62, 28, 200, 79"
HREF="dhtml.htm">
</MAP>
</P>
</BODY>
</HTML>

Last edited by buckky : 08-06-2004 at 06:27 AM.
buckky is offline
Reply With Quote
View Public Profile
 
Old 08-06-2004, 06:31 AM
Novice Talker

Posts: 5
buckky is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how to scale imagemaps?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15897 seconds with 12 queries