RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Types.PtInRect Function

Indicates whether a specified point lies inside a specified rectangle.

Pascal
function PtInRect(const Rect: TRect; const P: TPoint): Boolean;
C++
Boolean PtInRect(const TRect Rect, const TPoint P);

Types

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!