I want to know if the user has clicked outside or inside the borders of the map
Note that: the image containing the map is chosen as background of the form
So I thought of something
I have drawn the map with the following
RGB =255,255,255 outside the borders
RGB=254,254,254 inside the border
See what I have thought about:
Dim img1 As Bitmap
Expand|Select|Wrap|Line Numbers
- Private Sub frmmap1_Load()
- img1 = New Bitmap("images\map.jpg", True)
- End Sub
- Private Sub frmmap1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
- If (img1.GetPixel(e.Location.X, e.Location.Y).R = 255 Then
- MsgBox("out")
- Else
- MsgBox("in")
- End if
- End sub
Can I do the same test directly on the background of the form without loading img1?
Or is there any other way of thinkin
Regards