Important: The information in this document is obsolete and should not be used for new development.
RectInIconSuite
You can use theRectInIconSuitefunction 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,RectInIconSuitedetermines, from the size of the rectangle specified in this parameter, which icon mask from the icon suite specified bytheIconSuiteto test thetestRectparameter 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 ofPlotIconSuiteon page 5-35 for a list of constants you can use in this parameter.theIconSuite- A handle to an icon suite.
DESCRIPTION
TheRectInIconSuitefunction hit-tests the rectangle specified bytestRect
against the appropriate icon mask from the icon suite as it appears in theiconRectrectangle. The parametersiconRectandalignshould be the same as when the icon was last drawn. TheRectInIconSuitefunction returnsTRUEif the rectangle intersects the icon mask andFALSEif it doesn't.For example, if the coordinates of the
iconRectparameter 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 thealignparameter) within theiconRectrectangle. The function then intersects the rectangle specified bytestRectwith the icon mask in theiconRectrectangle. Continuing with this example, if the icon mask is left-aligned so that its rightmost pixel appears at coordinates (112,112) and the coordinates oftestRectare
(114,114,130,130), thenRectInIconSuitereturnsFALSE.