|
-
May 22nd, 2007, 12:49 PM
#1
Thread Starter
Addicted Member
-
May 22nd, 2007, 02:29 PM
#2
Thread Starter
Addicted Member
Re: Testing for image over image
I thought of checking the .top of every imageholder, but am not sure if this is the way to go? it seems like a lot of looping
-
May 22nd, 2007, 03:17 PM
#3
Re: Testing for image over image
vb Code:
Private Function Overlapped(pObj1 As Object, pObj2 As Object) As Boolean
If ((pObj1.Top + pObj1.Height >= pObj2.Top And _
pObj1.Top <= (pObj2.Top + pObj2.Height)) And _
(pObj1.Left <= pObj2.Left + pObj2.Width And _
pObj1.Left + pObj1.Width >= pObj2.Left)) Then
Overlapped = True
End If
End Function
Then you can use it like this
vb Code:
If Overlapped(Image1, Image2) Then
'Overlap, do Something here
End If
-
May 22nd, 2007, 03:38 PM
#4
Thread Starter
Addicted Member
Re: Testing for image over image
Great thanks, but it's still a case of taking each image in turn and testing it against all the others, every time I move one, isn't it?
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
|