-
image map
I need to use a bitmap image and create hotspots that link to other images
within my program how do i do this. I know its called an image map but i
have no idea how to make one
can anyone suggest
Thanks
Christine
-
Re: image map
Christine -
Three ways to do this:
1. Get a third party control (I am sure that one must exist).
2. Assuming you don't mind the overhead of Internet Explorer, use the
WebBrowser control, and learn how to do client-side image mapping in HTML.
3. Do it in straight VB by using a picture box to contain your image, and
using an array of image controls (containing no images) inside the picture
box to represent the hotspots. These will have the correct MousePointer=99
and your custom MouseIcon. On its Click event, you do your stuff.
--
Mark Alexander Bertenshaw
Programmer/Analyst
PrimeResponse
Brentford
UK
"Christine Hatton" <christinehatton@home.com> wrote in message
news:39a180a7$2@news.devx.com...
>
> I need to use a bitmap image and create hotspots that link to other images
> within my program how do i do this. I know its called an image map but i
> have no idea how to make one
>
> can anyone suggest
>
> Thanks
>
> Christine
-
Re: image map
Christine,
Are you talking about an HTML imagemap? If so search for HTL guides on the
Web.
You can emulate an image map in VB.
First, put something like this into the form's declaration:
Private Enum EnumLocation
LocationSave
LocationOpen
LocationPlay
LocationUnknown
End Enum
Private meLocation as EnumLocation
Then, load a BMP into a picture box in the form_load:
Set picImageMap.Picture = LoadPicture("MyPic.BMP")
Next, decide the hotspot on the mouse move event of the picture. Add code
similar to this:
Select Case Y
Case Is < 10, Is > 90
meLocation = LocationUnknown
Case Is < 50
Select Case X
Case Is < 10, Is > 90
meLocation = LocationUnknown
Case Is < 50
meLocation = LocationOpen
Case Else
meLocation = LocationSave
End Select
Case Else
meLocation = LocationPlay
End Select
With lblStatus
Select Case meLocation
Case LocationOpen
.Caption = "Open"
Case LocationPlay
.Caption = "Play"
Case LocationSave
.Caption = "Save"
Case LocationUnknown
.Caption = vbNullString
End Select
End With
I assumed picture is 100 twips (This is a rediculous size for a picture!)
and the hot spots are divided for this sample like so:
+-------------+-------------+
| Open | Save |
+-------------+-------------+
| Play |
+----------------------------+
Finally, Add code in the Mouse Down event to execute the hot spot:
Select Case meLocation
Case LocationOpen
Open
Case LocationPlay
Play
Case LocationSave
Save
End Select
--
~~~
C'Ya,
mrfelis
mrfelis@yahoo.NOSPAM.com
just remove the spam
Christine Hatton <christinehatton@home.com> wrote in message
news:39a180a7$2@news.devx.com...
>
> I need to use a bitmap image and create hotspots that link to other images
> within my program how do i do this. I know its called an image map but i
> have no idea how to make one
>
> can anyone suggest
>
> Thanks
>
> Christine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks