RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Types.IntersectRect Function

Returns the intersection of two rectangles

Pascal
function IntersectRect(out Rect: TRect; const R1: TRect; const R2: TRect): Boolean;
C++
Boolean IntersectRect(TRect Rect, const TRect R1, const TRect R2);

Types

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. 

 

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