/// <summary>
/// 判断点是否在某个区域内
/// </summary>
/// <param name="pointX">点横坐标</param>
/// <param name="pointY">点纵坐标</param>
/// <param name="points">区域顶点坐标集合</param>
/// <returns>true:是,false:否</returns>
public bool JudgmentInclusion(int pointX, int pointY, Point[] points)
{
Point pt = new Point(pointX, pointY);
var path = new GraphicsPath();
path.AddPolygon(points);
var region = new Region(path);
var state = region.IsVisible(pt);
return state;
}

本文来自博客园,作者:雨到了这里缠成线,转载请注明原文链接:https://www.cnblogs.com/ZhaoMingYuan/p/15787084.html
浙公网安备 33010602011771号