Skip to content

IntersectRect

Return the intersection of 2 rectangles.

Declaration

Source position: types.pp line 544

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

Description

IntersectRect returns the intersection of the 2 rectangles R1 and R2 in Rect. It returns True if the 2 rectangles have an intersection, otherwise False is returned, and Rect is filled with zero.

See also

Name Description
PtinRect Check whether a point is inside a rectangle.
UnionRect Return the union of 2 rectangles.
IsRectEmpty Check whether a rectangle is empty.
OffsetRect Offset the rectangle.
InflateRect Increase the rectangle in size, keeping it centered.
Size Return the size of the rectangle.