|
-
Apr 19th, 2006, 11:57 PM
#1
Thread Starter
New Member
[2005] help with interactive images
I'm new here so I'd first like to start by saying a formal hello to everyone I recently did the switch from vb6 to vb.net and ran into my first snag. I need a way to make a map in my program have 5 seperate regions that are able to be clicked on and envoke a command. The ocx i was attempting to use from silverband software entitled image vb is a vb6 based controller and doesn't seem to want to play nicely in 2005. Any help is greatly apperciated. Thanks.
-
Apr 20th, 2006, 02:22 AM
#2
Re: [2005] help with interactive images
Instead of using the Click function, you can make a sub for the mousedown event. Inside that event, the X and Y position of the mousedown is available using the MouseEventArgs parameter, such as this:
VB Code:
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
If e.X > SomeValue AndAlso e.X < SomeOtherValue AndAlso e.Y > SomeYValue AndAlso e.Y < SomeOtherYValue Then
'Inside region
End If
End Sub
Bill
-
Apr 20th, 2006, 09:44 AM
#3
Thread Starter
New Member
Re: [2005] help with interactive images
Bill
Apperciate the help. It appears that the code is for rectangle and square regions any idea how to do it for a odd shape polygon this is a copy of the coordinate file for the map where the regions are located.
<MAP name="Airfield">
<AREA id="air1" shape=POLY coords=400,160,265,162,273,428,385,434,435,308>
<AREA id="air2" shape=POLY coords=21,301,126,333,253,410,347,606,180,614,26,612>
<AREA id="air3" shape=POLY coords=665,305,477,298,454,411,353,463,353,566,662,623>
<AREA id="air4" shape=POLY coords=647,6,384,15,379,138,473,178,478,255,604,280,647,204>
<AREA id="term" shape=POLY coords=35,7,330,9,124,318,27,286>
</MAP>
-
Apr 20th, 2006, 10:03 AM
#4
Re: [2005] help with interactive images
whay exact problem are you having with the OCX? for the most part, you should be able to use activeX controls from VB6 in .NET
-
Apr 20th, 2006, 03:11 PM
#5
Thread Starter
New Member
Re: [2005] help with interactive images
problem is i set the image and coordinate file into the property fields after which i complete the following as the example shows on the vb image site.
Private Sub airmap_HotspotMouseDown(air1 As _
String, Button As Integer, Shift As Integer, X As _
Single, Y As Single)
msgbox("air side one")
End Sub
the airmap is the name of the refrenced image and the air1 is the id reference from a html file i have included. I have it set to envoke a msgbox to make sure it works but no matter how i tweek the settings i can't seem to find much succcess.
~Tim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|