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: More Macintosh Toolbox /
Chapter 5 - Icon Utilities / Icon Utilities Reference
Icon Utilities Routines / Determining Whether a Point or Rectangle Is Within an Icon


RectInIconID

You can use the RectInIconID function to hit-test a rectangle against the appropriate icon mask from an icon family for a specified destination rectangle and alignment.

FUNCTION RectInIconID (testRect: Rect; iconRect: Rect;
                       align: IconAlignmentType;
                       iconID: Integer): 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 PtInIconID, RectInIconID determines, from the size of the rectangle specified in this parameter, which icon mask from the icon family to test the testRect 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 of PlotIconID on page 5-20 for a list of constants you can use in this parameter.
iconID
A resource ID for an icon family.
DESCRIPTION
The RectInIconID function hit-tests the rectangle specified by testRect against the appropriate icon mask from the icon family as it appears in the iconRect rectangle. The parameters iconRect and align should be the same as when the icon was last drawn. The RectInIconID function returns TRUE if the rectangle intersects the icon mask and FALSE if it doesn't.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996