buckwheat4948
asked on
How do you make a image/picture box like html image map
I would like to be able to click in different areas of a image/picture to do different tasks, like imagemaps for html. Click on one spot, load this form, in another spot in the same image and load a different form.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could also add some method such as AddHotSpot() and RemoveHotSpot() to allow the form to track a set of imagemapped areas. Later the array can be used to determine if the user clicked on an area.
Sample method:
Private Sub AddHotSpot(HotSpotName as string, X1_Position as single, Y1_Position as single, X2_Position as single, Y2_Position as single)
dim intHotSpotCount as integer
intHotSpotCount = ubound(mstrHotSpotNameArra y)+1
redim preserve mstrHotSpotNameArray(intHo tSpotCount )
redim preserve msglHotSpotCoordArray(3,in tHotSpotCo unt)
mstrHotSpotNameArray(intHo tSpotCount ) = HotSpotName
msglHotSpotCoordArray(0,in tHotSpotCo unt) = X1_Position
msglHotSpotCoordArray(1,in tHotSpotCo unt) = Y1_Position
msglHotSpotCoordArray(2,in tHotSpotCo unt) = X2_Position
msglHotSpotCoordArray(3,in tHotSpotCo unt) = Y2_Position
end sub
private sub RemoveHotSpot(HotSpotName as string)
dim intHotSpotCntr as integer
for intHotSpotCntr = 0 to ubound(mstrHotSpotNameArra y)
if mstrHotSpotNameArray(intHo tSpotCntr) = HotSpotName then
' shift all subsequent items down or possibly just void this entry
' *** code to shift, then redim
exit for
endif
next intHotSpotCntr
end sub
Sample method:
Private Sub AddHotSpot(HotSpotName as string, X1_Position as single, Y1_Position as single, X2_Position as single, Y2_Position as single)
dim intHotSpotCount as integer
intHotSpotCount = ubound(mstrHotSpotNameArra
redim preserve mstrHotSpotNameArray(intHo
redim preserve msglHotSpotCoordArray(3,in
mstrHotSpotNameArray(intHo
msglHotSpotCoordArray(0,in
msglHotSpotCoordArray(1,in
msglHotSpotCoordArray(2,in
msglHotSpotCoordArray(3,in
end sub
private sub RemoveHotSpot(HotSpotName as string)
dim intHotSpotCntr as integer
for intHotSpotCntr = 0 to ubound(mstrHotSpotNameArra
if mstrHotSpotNameArray(intHo
' shift all subsequent items down or possibly just void this entry
' *** code to shift, then redim
exit for
endif
next intHotSpotCntr
end sub
ASKER
Thanks, the others replies were more detailed than i needed. After adding an if statement with a y cord, i got what i needed working perfectly. Thanks for the quick reply!
https://www.experts-exchange.com/questions/20166275/Problem-with-hot-spots-in-resizing-pictures.html