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;

posted @ 2014-03-19 13:50  kadajEvo  阅读(305)  评论(0)    收藏  举报