Important: The information in this document is obsolete and should not be used for new development.
RectInRgn
To determine whether a rectangle intersects a region, use theRectInRgnfunction.
FUNCTION RectInRgn (r:\xDDRect; rgn:\xDDRgnHandle):\xDDBoolean;
r- The rectangle to check for intersection.
rgn- A handle to the region to check.
DESCRIPTION
TheRectInRgnfunction checks whether the rectangle specified in therparameter intersects the region whose handle you pass in thergnparameter. TheRectInRgnfunction returnsTRUEif the intersection encloses at least 1 bit orFALSEif it does not.SPECIAL CONSIDERATIONS
TheRectInRgnfunction sometimes returnsTRUEwhen the rectangle merely intersects the region's bounding rectangle. If you need to know exactly whether a given rectangle intersects the actual region, you can use theRectRgnprocedure (described on page 3-88) to set the rectangle to a region, and callSectRgn(described on page 3-90) to see whether the two regions intersect. If the result ofSectRgnis an empty region, then the rectangle doesn't intersect the region.