Hi Tony
Access the C# dll code is something I have never done before I have referenced the .dll ok and come up with the following to load rectangles into the tree and query it. But do not know how to define a rectangle object correctly or define the item as an IHasRect correctly for the tree definition. If you could provide an example of how you would do it that would be great.
Regards
Justin Ralston
Public Sub Find_Overlapping_Text()
'Create the quadtree using the C# .dll from the website http://www.codeproject.com/KB/recipes/QuadTree.aspx
'to the extents of the points text
'To access the C# code that you want it be compiled as a DLL. Once that is done,
'simple add a reference to that project to your VB.Net project, import the namespace you need,
'and then you can use the C# code
Dim r As Rectangle = (100),100,100,100) 'Me.ClientRectangle
Dim item As IHasRect
Dim m_quadTree As New QuadTree(Of Item)(r)
'Dim m_quadTree As New QuadTree(Of Item)(Me.ClientRectangle)
'add random points (text rectangles) into the quadtree for querying
Random(rand = New Random(DateTime.Now.Millisecond))
m_quadTree.Add(New Item(e.Location, rand.Next(25) + 4))
'loop through all the text rectangles and
'Query the quadtree with a rectangle to find any other text objects under it
Dim m_selectionRect As Rectangle = (20),20,20,20)
m_selectedItems = m_quadTree.Query(m_selectionRect)
End Sub
Regards
Justin Ralston
http://c3dxtreme.blogspot.com/