Lets say that I've got the coordinates of two Rectangle
s, they could be right next to each other or have space between them. I need to draw a PolygonHotSpot
around the two rectangles (so it will only cover the two rectangles and the space between them). I've come to find that I have to give the coordinate开发者_JS百科s a clockwise order around the entire polygon, rather than around each rectangle (which works fine for a single rectangle).
So given a list of coordinates, is there a way to get them into the order that I need for there to not be any gaps in my PolygonHotSpot
?
You want the Union
of the two:
Dim R1 As New Rectangle(20, 20, 100, 100)
Dim R2 As New Rectangle(200, 200, 100, 100)
Dim R3 = Rectangle.Union(R1, R2) '//R3 = 20, 20, 280, 280
精彩评论