locked
How to create an image map ( hotspots) RRS feed

  • Question

  • Hi
    I just started using expression blend today and was wondering if any one could tell me about how to make hotspots in an image. please help

    us
    Thursday, March 13, 2008 12:10 AM

Answers

  • Hi,

    As I understand, you want to define some regions for an existing image, and based on which area you click (or mouse over), you will execute a specific action. If that's the case, here is one easy way to achieve this:
    - draw one shape for each area you want to define, on top of the image
    - set the Opacity property to 0 (this way you will make the shapes invisible, but they will still be hit tested by wpf)
    - add event handlers for those shapes for the actions you would like to handle (click, mouse over, etc). As a quick way to test this behavior, you could set the Tooltip property for those shapes to some specific text; when you run your application you should see the tooltip when moving the mouse over the regions (shapes) you defined.

    Hope this helps,
    - Adrian

    - Adrian Vinca [MSFT]
    Content is provided "AS IS" with no warranties and confers no rights.
    Friday, March 14, 2008 9:39 AM

All replies

  • Hi,

    As I understand, you want to define some regions for an existing image, and based on which area you click (or mouse over), you will execute a specific action. If that's the case, here is one easy way to achieve this:
    - draw one shape for each area you want to define, on top of the image
    - set the Opacity property to 0 (this way you will make the shapes invisible, but they will still be hit tested by wpf)
    - add event handlers for those shapes for the actions you would like to handle (click, mouse over, etc). As a quick way to test this behavior, you could set the Tooltip property for those shapes to some specific text; when you run your application you should see the tooltip when moving the mouse over the regions (shapes) you defined.

    Hope this helps,
    - Adrian

    - Adrian Vinca [MSFT]
    Content is provided "AS IS" with no warranties and confers no rights.
    Friday, March 14, 2008 9:39 AM
  • how can i add a tooltip to an image..
    Friday, March 14, 2008 11:42 AM
  • You can add a tooltip to almost any type of object: select the object and search for the "Tooltip" property in the property inspector and you can set some text as the tooltip.

    Thanks,
    - Adrian

    - Adrian Vinca [MSFT]
    Content is provided "AS IS" with no warranties and confers no rights.
    Saturday, March 15, 2008 1:32 AM
  • hello there,

    Can you be more specific when u say add event handlers for those shapes what I have to do if I want to have
    for example another image when u rollover this shape ?

    http://3ddream.deviantart.com
    Thursday, April 24, 2008 9:30 AM
  • Thanks a lot. This helped solve a problem we have been looking at since yesterday, within an hour.
    Sunday, April 11, 2010 10:35 PM
  • Thanks a lot. This helped solve a problem we have been looking at since yesterday, within an hour.
    Sunday, April 11, 2010 10:36 PM