RectInRgn
RectInRgn Check if a rectangle intersects a region Rect *theRect ; address of 8-byte Rect structure RgnHandle theRgn ; handle of the region of interest returns Is any part of theRect inside of theRgn ?
RectInRgn returns an indication of whether any pixel enclosed by a specified rectangle intersects with a specified region.
theRect is the address of an 8-byte Rect structure, defined in local or global coordinates.
theRgn is a handle to a region. It should be defined in the same coordinate
system as theRect .
Returns: a Boolean value indicating whether the rectangle intersects with the region. It is one of:
TRUE At least one pixel is in both areas
Notes: Remember that the outlines of theRect and theRgn are infinitely thin, so
just sharing a line or point does not constitute an inter section. This
returns TRUE when a pixel (the dot below and to the right of the point coordinates) is enclosed by both areas.
An error in the early ROMs occasionally causes this function to incorrectly
return TRUE when the enclosing coordinates overlap (even though they do not share any pixels). You may need to convert the rectangle to a region
answer here. Later versions of the ROMs work correctly.