本文整理自网络,侵删。
判断某一个点TPOINT是否在一个区域内TRECT用PtInRect函数,函数具体用法如下:
Indicates whether a specified point lies inside a specified rectangle.
Unit
Types
Category:
geometric routines
Delphi syntax:
function PtInRect(const Rect: TRect; const P: TPoint): Boolean;
C++ syntax:
extern PACKAGE bool __fastcall PtInRect(const TRect Rect, const TPoint P);
Description
PtInRect returns true if the point, P, lies inside the rectangle, Rect, and false if P is not in Rect.
PtInRect does not consider a point inside a rectangle if the rectangle has a negative width or height. A point is considered inside a rectangle if it lies on the left or top edge, but not if it lies on the right or bottom edge.
相关阅读 >>
Delphi ttabcontrol在tabitem添加关闭按钮
关于公历与农历换算和时间处理的单元 calendar.pas
更多相关阅读请进入《Delphi》频道 >>