Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing / QuickDraw Drawing Reference
Routines / Creating and Managing Regions


To determine whether a rectangle intersects a region, use the RectInRgn function.

FUNCTION RectInRgn (r:\xDDRect; rgn:\xDDRgnHandle):\xDDBoolean;
The rectangle to check for intersection.
A handle to the region to check.
The RectInRgn function checks whether the rectangle specified in the r parameter intersects the region whose handle you pass in the rgn parameter. The RectInRgn function returns TRUE if the intersection encloses at least 1 bit or FALSE if it does not.

The RectInRgn function sometimes returns TRUE when 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 the RectRgn procedure (described on page 3-88) to set the rectangle to a region, and call SectRgn (described on page 3-90) to see whether the two regions intersect. If the result of SectRgn is an empty region, then the rectangle doesn't intersect the region.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996