利用Region.IsVisible方法
示例代码:
Point[] points2 = { new Point(15, 15), new Point(90, 20), new Point(130, 160), new Point(60, 160), new Point(5, 80) };
GraphicsPath path = new GraphicsPath(); path.AddPolygon(points2); path.CloseFigure(); Region region = new Region(path); Point point = new Point(10, 10); if (region.IsVisible(point))
此方法对于点在区域边界的情况,判断是在区域外。