GDI画图,判断鼠标点击点在某一画好的多边形、矩形、图形里
判断 点击 鼠标 图形 矩形 画图 多边形 gdi
2023-09-27 14:23:42 时间
Region.IsVisible方法
简单方便准确
private bool CheckPntInPoly(Point[] points, Point pnt) { if (points == null || points.Length == 0 || pnt == Point.Empty) { return false; } System.Drawing.Drawing2D.GraphicsPath myGraphicsPath=newSystem.Drawing.Drawing2D.GraphicsPath(); Region myRegion=new Region(); myGraphicsPath.Reset(); myGraphicsPath.AddPolygon(points); myRegion.MakeEmpty(); myRegion.Union(myGraphicsPath); //返回判断点是否在多边形里 return myRegion.IsVisible(pnt); }
相关文章
- POJ3189二分最大流(枚举下界,二分宽度,最大流判断可行性)
- php中密码强中弱判断
- 利用 keyCode 判断用户按下哪个键
- [转]js判断数据类型的四种方法
- 【Excel】+if多个条件组合判断
- liunx下判断有线网口硬件是否正常的三个常用方式
- 力扣解法汇总2283. 判断一个数的数字计数是否等于数位的值
- input取value,判断value是否为空。null/undefined/''的区别
- C# WinForm点击Radio判断是否选中,监控TextBox输入动作
- uploadify上传之前判断一个input输入框是否为空
- 用javascript的isNan()函数,可以判断是否为数字
- 判断和调整library cache,data dictionary cache,buffer cache性能
- Unity 物体跟随鼠标点击移动,判断物体是否在移动
- Swift - 点击事件奇偶次判断
- [C#.Net]判断文件是否被占用的两种方法