Important: The information in this document is obsolete and should not be used for new development.
SectRect
To determine whether two rectangles intersect, you can use theSectRectfunction.
FUNCTION SectRect (src1,src2:\xDDRect; VAR dstRect: Rect): Boolean;
src1- The first of two rectangles to test for intersection.
src2- The second of two rectangles to test for intersection.
dstRect- The rectangle marking the intersection of the first two rectangles.
DESCRIPTION
TheSectRectfunction calculates the rectangle that delineates the intersection of the two rectangles you specify in thesrc1andsrc2parameters. TheSectRectfunction returns the area of intersection in thedstRectparameter and a function result ofTRUEif they intersect orFALSEif they don't. Rectangles that touch at a line or a point are not considered intersecting, because their intersection rectangle (actually, in this case, an intersection line or point) doesn't enclose any pixels in the bit image.If the rectangles don't intersect, the destination rectangle is set to (0,0,0,0). The
SectRectprocedure works correctly even if one of the source rectangles is also the destination.