System.Types.PtInRect

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function PtInRect(const Rect: TRect; const P: TPoint): Boolean;
function PtInRect(const Rect: TRectF; const P: TPointF): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall PtInRect(const TRect &Rect, const TPoint &P)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Types.pas
System.Types.hpp
System.Types System.Types

Description

Indicates whether a specified point lies inside a specified rectangle.

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.

See Also

Code Examples