

| General Properties Methods Events Example |
Note: Standard control properties such as Name, Height/Width, Index, Visible, etc., are not listed here. See the Visual Basic documentation for help on standard control properties.
| AutoSize |
HotspotMouseIconFile
|
AutoSize (Boolean)
Determines if the control automatically resizes to fit the entire image set in the Picture property (true) or not (false). If set to False, the height and width of the control will remain constant; the image will be clipped if its dimensions are larger than the control. This property is similar to the AutoSize property of the PictureBox that ships with Visual Basic. Default is True.
Usage Example: ImageMap1.Autosize = True
Border (Boolean)
Determines if the border around the control is visible (true) or not (false). When visible, the border gives the image map a 3-D "sunken" look. This property is similar to the Border property of the PictureBox that ships with Visual Basic. Default is True.
Usage Example: ImageMap1.Border = True
CoordsFile (String)
Returns/sets the path to the file containing the coordinates of the hotspots. The coordinates are defined in HTML syntax. For example:
<map name="mymap"> <area id="Rect1" shape="RECT" coords="53,13,127,70"> <area id="Rect2" shape="RECT" coords="346,55,416,145"> <area id="Some Shape" shape="POLY" coords="343,177,271,206,241,324,231,207,171,179"> <area id="MyCircle" shape="CIRCLE" coords="250,72,37"> </map>
If the <area> tag has an "id" attribute, its value will be used to identify the hotspot in the events HotspotClick, HotspotDblClick, HotspotMouseDown, HotspotMouseMove, and HotspotMouseUp. If no "id" attribute is found, the value for "alt", "title", "class", or "name" will be used to determine the hotspot id. If none of those attributes are present, the hotspot will be given the id of "Hotspot #", where # is the nth <area> tag found in the map. For example, if the current hotspot was defined in the 3rd <area> tag, it will have a HotspotID of "Hotspot 3". The attribute "id" will always be used if found, regardless if the other tags are present or not.
Each hotspot can have a unique color. You can set the color of individual hotspots in the <map> HTML, whether in the CoordsString property or in an HTML file. Just add an attribute called "color" to the <area> tag of the hotspot you wish to have a different color, and use standard HTML color syntax for the value. For example:
<area shape="circle" coords="171,127,44" id="Sphere" color="#0000ff">
The line above came from the file "objects.htm" that is part of the sample project included in the download package. If you run the sample project, and check the box to "Show Hotspots" at the top of the window, notice that the sphere is blue. You can change the Hotspot Color for the other hotspots in the picture, but the sphere will remain blue. This is because if the "color" attribute is found in an <area> tag, the HotspotColor property will no longer apply to that hotspot.
To change the color of a hotspot at runtime, you must change the HTML in the CoordsString property, OR in the HTML file and re-set the CoordsFile property, depending on if you are using a string or file to set the map coordinates.
Quotation marks are necessary only if the attribute contains one or more spaces. For example, id=somename and id="somename" are both valid, however, id=some name is not and will be interpreted as id=some (the word name will be ignored).
An entire HTML page can be used as well - including <HEAD>, <BODY> and any other HTML tags and text. The VB Image Map control will automatically locate the map and area coordinates within the file. If the file contains more than one <map>, only the first one will be used.
The coordinates file can have any name and extension. For example, you could call your coordinates file "client.dll" or something even more cryptic if you want.
If both the CoordsFile and CoordsString properties are set, the last one entered takes precedence. If both are entered simultaneously (i.e. in the Properties Window), CoordsString is used.
Usage Examples:
ImageMap1.CoordsFile = App.Path & "\coords.htm"
or
ImageMap1.CoordsFile = stringVariable
CoordsString (String)
Returns/sets a string of HTML containing the map coordinates. See CoordsFile above for details and example syntax.
Usage Examples:
ImageMap1.CoordsString = "<map name=""mymap""><area
id=..." or
ImageMap1.CoordsString = stringVariable
HotspotColor (Long)
Returns/sets the color of the hotspots when visible. It is used in conjunction with HotspotDrawMode to determine the appearance of the picture underneath the hotspot. Only has an effect if ShowHotspots is set to True. Default is red.
The color can be any normal RGB color set with the RGB or QBColor functions in code, or colors specified with the system color constants in the VB object library in the Object Browser. The Microsoft Windows operating environment substitutes the user's choices, as specified by the user's Control Panel settings.
Usage Examples:
ImageMap1.HotspotColor = vbRed or
ImageMap1.HotspotColor = RGB(255, 0, 0)
HotspotDrawMode (Long - Enumerated)
Returns/sets the method by which the HotspotColor is combined with colors in the Picture within the area of a hotspot. Only has an effect if ShowHotspots is set to True.
Settings are:
| BLACK | Pure black. |
| NOTMERGEPEN | Inverse of MERGEPEN. |
| MASKNOTPEN | Combination of the colors common to the picture and the inverse of HotspotColor. |
| NOTCOPYPEN | Inverse of COPYPEN. |
| MASKPENNOT | Combination of the colors common to both the HotspotColor and the inverse of the picture. |
| INVERT | Inverse of the picture. |
| XORPEN | Combination of the colors in the HotspotColor and in the picture color, but not in both. |
| NOTMASKPEN | Inverse of MASKPEN. |
| MASKPEN | Default. Combination of the colors common to both the HotspotColor and the picture. |
| NOTXORPEN | Inverse of XORPEN. |
| NOP | No operation, output remains unchanged. In effect, this setting turns drawing off. |
| MERGENOTPEN | Combination of the picture color and the inverse of the HotspotColor. |
| COPYPEN | Solid HotspotColor. |
| MERGEPENNOT | Combination of the HotspotColor and the inverse of the picture color. |
| MERGEPEN | Combination of the HotspotColor and the picture color. |
| WHITE | Pure white. |
Usage Example: ImageMap1.HotpotDrawMode = INVERT
HotspotMouseIcon (StdOLE Picture)
Returns/sets a custom mouse icon for when the cursor is positioned over a hotspot.
When setting the HotspotMouseIcon property at design time (via the Properties Window), the custom cursor is saved and loaded with the form. If you create an executable file, the file contains the mouse icon. When you load an icon at run time, is not saved with the application.
The VB Image Map OCX does not support animated cursor (.ani) files.
Usage Examples:
Set ImageMap1.HotspotMouseIcon = LoadPicture(App.Path &
"\hand.cur")
Set ImageMap1.HotspotMouseIcon = PictureBox1.Picture
HotspotMouseIconFile (String)
Returns/sets the path to a custom mouse icon file for when the cursor is positioned over a hotspot.
See the HotspotMouseIcon property above for more details.
Usage Example:
ImageMap1.HotspotMouseIconFile = App.Path & "\hand.cur"
MouseIcon (StdOLE Picture)
Returns/sets a custom mouse icon for when the cursor is positioned anywhere over the Image Map control.
See the HotspotMouseIcon property above for more details.
Usage Examples:
Set ImageMap1.MouseIcon = LoadPicture(App.Path & "\hand.cur")
Set ImageMap1.MouseIcon = PictureBox1.Picture
MouseIconFile (String)
Returns/sets the path to a custom mouse icon file for when the cursor is positioned anywhere over the Image Map control.
See the HotspotMouseIcon property above for more details.
Usage Examples:
Set ImageMap1.MouseIcon = App.Path & "\hand.cur"
Picture (StdOLE Picture)
Returns/sets the graphic to be displayed as the background of the Image Map control. This is the image that will be "mapped out" using the coordinates set with either the CoordsFile or CoordsString property.
When setting the Picture property at design time (via the Properties Window), the graphic is saved and loaded with the form. If you create an executable file, the file contains the image. When you load a graphic at run time, the graphic is not saved with the application.
At run time, the Picture property can be set to any other object's DragIcon, Icon, Image, or Picture property, or you can assign it the graphic returned by the LoadPicture function.
Graphics formats recognized by the VB Image Map OCX include bitmaps (.bmp), JPEGs (.jpg), GIFs (.gif), run-length encoded (.rle) files, Windows metafiles (.wmf), enhanced metafiles (.emf), icons (.ico), and cursor (.cur) files.
Usage Examples:
Set ImageMap1.Picture = LoadPicture(App.Path & "\map.gif")
Set ImageMap1.Picture = PictureBox1.Picture
PictureFile (String)
Returns/sets the path to a graphic file to be displayed as the background of the Image Map control. This is the image that will be "mapped out" using the coordinates set with either the CoordsFile or CoordsString property.
Graphics formats recognized by the VB Image Map OCX include bitmaps (.bmp), JPEGs (.jpg), GIFs (.gif), run-length encoded (.rle) files, Windows metafiles (.wmf), enhanced metafiles (.emf), icons (.ico), and cursor (.cur) files.
Usage Example:
ImageMap1.PictureFile = App.Path & "\map.gif"
ShowHotspots (Boolean)
Determines whether the hotspots are visible (true) or not (false). This does not affect the functionality of the hotspots - it only determines if the hotspots are drawn on the image and are visible to the user. Hotspot events are always raised regardless of this setting. ShowHotspots must be set to True for HotspotColor and HotspotDrawMode to have any effect. Default is False.
Usage Example: ImageMap1.ShowHotspots = True