Important: The information in this document is obsolete and should not be used for new development.
RectInIconSuite
You can use theRectInIconSuite
function to hit-test a rectangle against the appropriate icon mask from an icon suite for a specified destination rectangle and alignment.
FUNCTION RectInIconSuite (testRect: Rect; iconRect: Rect; align: IconAlignmentType; theIconSuite: Handle): Boolean;
testRect
- The rectangle to be tested, specified in local coordinates of the current graphics port.
iconRect
- The rectangle in which the icon appears, specified in local coordinates of the current graphics port. Like
PtInIconSuite
,RectInIconSuite
determines, from the size of the rectangle specified in this parameter, which icon mask from the icon suite specified bytheIconSuite
to test thetestRect
parameter against.align
- A value that specifies how the icon against which to hit-test is aligned within the rectangle specified by
iconRect
. See the description ofPlotIconSuite
on page 5-35 for a list of constants you can use in this parameter.theIconSuite
- A handle to an icon suite.
DESCRIPTION
TheRectInIconSuite
function hit-tests the rectangle specified bytestRect
against the appropriate icon mask from the icon suite as it appears in theiconRect
rectangle. The parametersiconRect
andalign
should be the same as when the icon was last drawn. TheRectInIconSuite
function returnsTRUE
if the rectangle intersects the icon mask andFALSE
if it doesn't.For example, if the coordinates of the
iconRect
parameter are (100,100,116,116) and the icon cache contains entries for each icon family member,RectInIconSuite
uses the icon mask defined by the'ics#'
entry. The function aligns this mask (according to thealign
parameter) within theiconRect
rectangle. The function then intersects the rectangle specified bytestRect
with the icon mask in theiconRect
rectangle. Continuing with this example, if the icon mask is left-aligned so that its rightmost pixel appears at coordinates (112,112) and the coordinates oftestRect
are
(114,114,130,130), thenRectInIconSuite
returnsFALSE
.