473,779 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically load Image Map coordinates

2 New Member
I have an asp.net site that uses a dropdown listbox to select 1 of 6 different images to be displayed at one time. Changing the image is working fine. But I need to define and use a different set of coordinates for each image. One image could have as few as 5 regions, while another could have up to 100. The coordinates will be hardcoded but I can't seem to figure out how to load different sets of "PolygonHotspot " based on which image is displayed. I thought it was going to be as easy as assigning an ID to 100 different hotspots, then turning them off or on and defining the coordinates based on the image name. That seemed like the perfect solution .. until I found out that the PolygonHotspot doesn't have an ID property.

Any help would be GREATLY appreciated! Please email me at bry at herp dot com

Thank you in advance,

Bryan Mohr
Mar 12 '07 #1
1 2397
BryanM
2 New Member
Just for reference (even though this doesn't work), here is the code that I was hoping would work:

Expand|Select|Wrap|Line Numbers
  1.     Protected Sub cbImageCombo_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbImageCombo.TextChanged
  2.         Dim strImageName As String = cbImageCombo.Text
  3.         Dim strImageText As String = strImageName
  4.  
  5.         strImageName = "~/Images/" & strImageName.Replace(" ", "_") & ".JPG"
  6.         imImage.ImageUrl = strImageName
  7.         imImage.AlternateText = strImageText
  8.  
  9.         ' First Make all Hotspots inactive
  10.         HS001.HotspotMode = "Inactive"
  11.         HS002.HotspotMode = "Inactive"
  12.         HS003.HotspotMode = "Inactive"
  13.  
  14.         ' Next activate the defined hotspots for the currently selected image
  15.         If (strImageText = "Spinal Cord Side") Then
  16.             HS001.HotSpotMode = "PostBack"
  17.             HS001.AlternateText = "Top Vertebrae"
  18.             HS001.Coordinates = "118,16,127,11,135,4,142,4,154,11,155,16,154,17,143,15,139,15,132,22,118,17,118,17"
  19.             HS001.PostBackValue = "Top Vertebrae"
  20.  
  21.             HS002.HotSpotMode = "PostBack"
  22.             HS002.AlternateText = "Second Vertebrae"
  23.             HS002.Coordinates = "118,32,131,24,131,22,139,15,154,17,156,32,141,25,138,25,137,27,137,29,121,38,119,36"
  24.             HS002.PostBackValue = "Second Vertebrae"
  25.         End If
  26.  
  27.         If (strImageText = "Skeleton Front") Then
  28.             HS001.HotSpotMode = "PostBack"
  29.             HS001.AlternateText = "Skull"
  30.             HS001.Coordinates = "120,14,126,7,134,3,138,3,146,6,151,11,154,17,154,27,152,39,148,41,148,49,142,53,132,53,125,49,125,43,124,39,121,35,121,32,119,28,119,16"
  31.             HS001.PostBackValue = "Skull"
  32.         End If
  33.  
  34.         If (strImageText = "Muscular Man Back") Then
  35.             HS001.HotSpotMode = "PostBack"
  36.             HS001.AlternateText = "Lateral Deltoid - Right"
  37.             HS001.Coordinates = "172,82,180,80,187,79,189,80,194,84,198,89,200,95,201,99,202,107,201,115,192,106,185,98,184,90,178,88,174,85"
  38.             HS001.PostBackValue = "Lateral Deltoid - Right"
  39.  
  40.             HS002.HotSpotMode = "PostBack"
  41.             HS002.AlternateText = "Posterior Deltoid - Left"
  42.             HS002.Coordinates = "100,97,101,114,86,128,81,126,90,107"
  43.             HS002.PostBackValue = "Posterior Deltoid - Left"
  44.  
  45.             HS002.HotSpotMode = "PostBack"
  46.             HS002.AlternateText = "Levator Scapulae - Left"
  47.             HS002.Coordinates = "109,75,127,64,132,57,130,73,112,76"
  48.             HS002.PostBackValue = "Levator Scapulae - Left"
  49.         End If
  50.     End Sub
  51.  
Mar 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
17257
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would do myDomElement.click and the mouse doesn't matter, but in the case of an input image element, what happens is the submitted url has something like "?x=12&y=7" appended to it (the numbers vary per mouse position on the clicked element). If you hit...
15
7058
by: Tony Gahlinger | last post by:
I'm using my browser (Mozilla/5.0 Linux i686 Gecko/20031007 Firebird/0.7) to do some client-side image processing. I want to capture the sequence of coordinates a user clicks on in xxx.jpg in the following html <a href="#"><IMG SRC="xxx.jpg" ISMAP></a> and save these to a file for later handling. The coordinates appear on the bottom left of the window as I move the mouse, so I know they're being passed around somehow, but I haven't...
9
3729
by: pablo | last post by:
Dear NGers, I would like to change the alt-text with the changing of the image during a mouseover action. Can document.images.altView be changed dynamically? TIA, pablo
1
4428
by: Asaf Dan | last post by:
Hi, I'm using a panel to show an image. The Image could be bigger or smaller than the panel. I want to show the pixel coordinates of the image on a label next to the panel. I'm using an event but i cant get to show the real image pixel's coordinates. I would appreciate any kind of help.
8
4316
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image button at runtime: //----- Code snippet protected System.Web.UI.WebControls.PlaceHolder ImageHolder; private void Page_Load(object sender, System.EventArgs e)
4
2455
by: Tomasz Bak | last post by:
Hello, I have a simple problem: mark a list of defects on an image. I think the best way to do it is to select a single deffect, then take two coordinates of coursor form an image on a web page (first when user press the button, and the second when he releases it). Those two points are going to be send to the web application (i.e. with AJAX) and saved in a database.
3
21272
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image' src='picture.gif' name='myimage' id='myimage'> </form> When forms with image types are submitted, the value is not returned; instead, when the form is submitted, the XY coordinates of the where the user clicked on the image are sent. For example, if the user
7
3648
by: petethebloke | last post by:
Can anyone help? I have a client who has made a "dynamic interactive map" of our city using Dreamweaver. Each map file has hotspots that pop-up a div with a little image when the mouse goes over them. They also link to another file. I've converting the application to a PHP-AJAX system at http://www.ilex-urc-maps.com/testing.html but I can't get the dynamically altered hotspots to work. Any ideas? Please don't tell me that the client...
2
2756
by: nvinhphu | last post by:
Dear all, I would like to generate images like the ones in the right column at this link http://www.micthemodel.org/pages/examples.html (Sorry but I can not post attachment). These images are in fact 2D slices of a 3D image of a cube containing a set
0
9471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10302
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.