trouble creating a imagemap

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 2.0

Any ideas why the code below don't create a clickable area?

<asp:ImageMap ID="ImageMap1" runat="server"
ImageUrl="~/Images/Menuitems/test.png" Height="108" Width="960">
<asp:PolygonHotSpot Coordinates="80,442,524, 546,106,444"
NavigateUrl="~/Default2.aspx" HotSpotMode="Navigate" />

</asp:ImageMap>
 
re:
!> Any ideas why the code below don't create a clickable area?

Coordinates="80,442,524, 546,106,444"

Those coordinates don't create an enclosed area.

Every number pair defines a point. You defined 6 points, so you should wind up with a triangle.

The three number pairs you've defined don't create a triangle.

See these examples :

http://www.maconstateit.net/tutorials/ASPNET20/ASPNET05/aspnet05-04.aspx

I'd go for a simpler shape, like a rectangle, to start.

For that, you need code like this :

<asp:ImageMap Runat="Server"
ImageUrl="ImageMap.jpg"
AlternateText="Web search image map"
HotSpotMode="Navigate">
<asp:RectangleHotSpot
AlternateText="Go to Google"
Left="49"
Top="36"
Right="216"
Bottom="148"
NavigateUrl="http://www.google.com"
Target="_blank"/>

If you see the rectangle in the link posted above, you'll understand.

Try opening Paint.exe and drawing an image with the size you want/need.
You'll see the coordinate points in Paint's status bar.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
=========================
 
Back
Top