Click to See Complete Forum and Search --> : Clickable images


Ruud B
June 27th, 2001, 09:42 AM
Does anyone know how to create clickable images similar to clickable images in HTML. I want to create an application with an interactive image. When the user clicks on different parts of the image the application should respond accordingly. I've been looking but can't find any information regarding this :(

Hope someone can help...

Cimperiali
June 27th, 2001, 09:49 AM
use an array of images (or more than one image) to dispay them as a contiguos one
Then code the (one for each imagebox):

private Sub Image1_Click()
'your code for clicking on this piece of image
End Sub
'or code the (for an array of imagebox)
private Sub Image1_Click(Index as Integer)
'your code for an index image
'ie:
select case index
case 0 'first image clicked
'your code for this click
case 1 'second... and so on
'your code for this click
end select
End Sub





Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.

shree
June 27th, 2001, 12:44 PM
Display your image in a picture box.

Then there are several functions such as CreateRectRgn(), CreateEllipticRgn(), CreatePolygonRgn() etc, that allow you to create regions of different shapes. Create a region that defines your clickable area.

In Picture1_MouseDown, check if the point is within one of the regions using PtInRegion(). If it is then do something.

Clearcode
July 11th, 2001, 02:51 AM
I have knocked this lot together to make a Visual Basic control version of the HTML client side Image Map and am looking for Beta testers.

I'll put the control (and code) up at http://www.merrioncomputing.com/Download/index.htm in the next couple of days...it basically works now but the interface for creating the image map items could do with cleaning up a bit.

Thanks in advance,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Clearcode
July 17th, 2001, 10:26 AM
The control is now available to download (with complete source)

HTH,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.