image map


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: image map

  1. #1
    Christine Hatton Guest

    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

  2. #2
    Mark Alexander Bertenshaw Guest

    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




  3. #3
    mrfelis Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center