Placing links within an image

Hi All,

Is there an example project or code somewhere that would show how to display an image and then allow the user to create links of various types within that image?
For example, if I have a floor plan and I want to allow the user to create a link or “pin” that points to a detailed description that is stored in the database or is a link to the alarm company’s website or to another image how might I go about that?
Currently this is a desktop application, not a web application.


Simplest way is to add code to the mousedown event, that checks x,y co-ordinates against criteria, and decides what to do based on that.
Very easy if you check if ‘inside a rectangle’

You might subclass a canvas, add a collection of areas, each of which carries a text value which determines where to go.

If the areas are irregular shapes (ie… click anywhere within the banana shape), then the easiest way to do that is to create a second image which is mostly white, and which has the clickable hotspots duplicated in unique colors.

Eg the banana shape might be &cFFFF00
A door might be &FF0000
and so on

When the user clicks on the main image, check the color of the same x,y co-ordinate of the second image.
Assuming the colors aren’t modified by color profiles, you can use a select case based on the color you find, and ‘goto’ something appropriate based on that.

Hi Jeff,

Thanks for this. I will play around and see what I can figure out and repost questions here.