c#点在平面内
1 Rectangle rect = new Rectangle(0, 0, 100, 100);//X,Y,W,H 2 Point testPoint1 = new Point(50, 60); 3 rect.Contains(testPoint1);//在矩形里面,返回true 4 5 Point testPoint2 = new Point(110, 20); 6 rect.Contains(testPoint2);//不在矩形里面,返回false
需要加 using System.Drawing;

浙公网安备 33010602011771号