System.Types.IntersectRect

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function IntersectRect(const Rect1, Rect2: TRect): Boolean;
function IntersectRect(out Rect: TRect; const R1, R2: TRect): Boolean;
function IntersectRect(const Rect1, Rect2: TRectF): Boolean;
function IntersectRect(out Rect: TRectF; const R1, R2: TRectF): Boolean;

C++

extern DELPHI_PACKAGE bool __fastcall IntersectRect(const TRect &Rect1, const TRect &Rect2)/* overload */;

Properties

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

Description

Returns the intersection of two rectangles

Call IntersectRect to obtain the rectangle that is the intersection of R1 and R2. The intersection is returned as the Rect parameter.

IntersectRect returns True if the two rectangles have a nonempty intersection. If R1 and R2 do not overlap, IntersectRect returns False, and the Rect parameter is set to a rectangle at position (0,0) with 0 Width and 0 Height.

See Also

Code Examples