围绕两个矩形绘制 PolygonHotSpot?
假设我已经获得了两个 Rectangle 的坐标,它们可以彼此相邻,也可以在它们之间有空间。我需要在两个矩形周围绘制一个PolygonHotSpot
(因此它只会覆盖两个矩形以及它们之间的空间)。我发现我必须围绕整个多边形而不是每个矩形(这对于单个矩形来说效果很好)按顺时针顺序排列坐标。
因此,给定一个坐标列表,有没有办法让它们按照我需要的顺序排列,以使我的PolygonHotSpot
中不存在任何间隙?
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 coordinates 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
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想要两者的
Union
:You want the
Union
of the two: