funded by  
The image map needs four components:
In your project, set a reference to this dll in the references section. You will then get an icon for the ImageMapControl in the "Windows Forms" section of the toolbox. This allows you to add the ImageMap to your forms like any other element.
Dim oImageData As ImageMapData
oImageData = New ImageMapData()
Now you can add the bitmap (this can be done later on, too):
oImageData.Bitmap = New Bitmap("C:\myImage.jpg")
Example 1: A rectangle in the upper left corner which is linked to "google" with the title "Search with Google":
Dim coords As Integer() = {0, 0, 100, 50}
Dim oArea As ImageMapArea
oArea = New ImageMapArea(ImageMapArea.Shapes.rect, coords, "http://www.google.com/",
"", "Search with Google")
oImageData.addArea(oArea)
The empty Command property will be filled with the HREF property.
Example 2: A circle at (120;220) with radius 50 which will just show some tooltip:
Dim coords As Integer() = {120, 220, 50}
Dim oArea As ImageMapArea
oArea = New ImageMapArea(ImageMapArea.Shapes.circle, coords, "",
"", "Just a tooltip")
oImageData.addArea(oArea)
ImageMapControl1.Data = oImageData
At this step, the ImageMapControl will resize to the size of the bitmap.
If you do not want it to resize, set the AutoSize
property to false:
ImageMapControl1.AutoSize = False
The control will automatically start the commands linked with the area elements. If you want to react on the selection of an area with your own code in the ImageMapControl1.AreaSelected event, set the AutoNavigate property is to false; you will get a reference to the selected area.
ImageMapControl1.AutoNavigate = False
Private Sub ImageMapControl1_AreaSelected(ByRef sender As Object,
ByRef e As CyDASGeneralControls.ImageMapAreaSelectedEventArgs) Handles
ImageMapControl1.AreaSelected
MsgBox("Area clicked:
" & e.SelectedArea.Title)
End Sub