Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating multiple clickable areas on an image (graphic)
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00174629
Message ID:
00174781
Views:
25
>>>How would I go about making an image react differently to clicks on different parts of it?
>>>
>>>I suppose I could use the mousedown event, but it there some easy way to get the coordinates of various freeform spots on an image?
>>>
>>>I thought there was a tool or something to help with that
>>>
>>>Thanx!
>>
>>If you speak about VFP form, then, I guess, you may use image control overlapped by invisible button(s).
>
>Yes, I thought about invisible buttons, but I want something that can be ANY shape.
>
>I'm trying to create a starting point for a new app I'm writing that works much the same way as a web graphic can work. In web terminology it would be called an imagemap. I want to define/map various hot spots on the image to take me to various options.
>
>Any way to do that in VFP without, for example, manually having to calculate pixel positions within an image and then reacting to MouseUp/Down accordingly?

You could give each hot spot a unique color. Use the mouse position parameters available in the image.MouseDown event, store them in your own form properties, then use the Form.Point method in the image.Click event. It is crude but effective. Your hot spots are just patterns on a single image control. They won't react visually when you click on them, and you won't be able to do anything with the mouse pointer. But you don't have to fiddle with Active-x controls. I came up with this simple method (with help from Ed) when someone asked me about making a clickable map of the USA.

If you want a better control that acts more like buttons, you might get one of those Active-x controls that does funny-shaped buttons. If what you have is a USA map or some other commonly seen image, there might be an active-x control specifically for that thing. I haven't looked.

If you plan to do a lot with clickable images, you might want an authoring tool such as IconAuthor or Authorware. These are powerful, expensive multimedia presentation tools which are not needed if you just want to make a couple of images on forms. We use IconAuthor to make photo libraries on CD. You can click on parts of photos and bring up other photos and data. From what I've read, IconAuthor is the one that connects most effectively with databases, and is also the most expensive ($4000 or so).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform