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 / Drawing Icons From Resources


PlotIconMethod

You can use the PlotIconMethod function to plot an icon obtained with the aid of an icon getter function for a specified destination rectangle and alignment.

FUNCTION PlotIconMethod (theRect: Rect; align: IconAlignmentType;
                         transform: IconTransformType;
                         theMethod: IconGetter;
                         yourDataPtr: UNIV Ptr): OSErr;
theRect
The rectangle in which to draw the icon, specified in local coordinates of the current graphics port.
align
A value that specifies how to align the icon within the rectangle specified by theRect. See the description of PlotIconID on page 5-20 for a list of constants you can use in this parameter.
transform
A value that specifies how PlotIconMethod should modify the appearance of the icon. See the description of PlotIconID beginning on page 5-20 for a list of constants you can use in this parameter.
theMethod
A pointer to an icon getter function.
yourDataPtr
A pointer to data that is passed to your icon getter function.
DESCRIPTION
The PlotIconMethod function uses your icon getter function to obtain the icon to draw. Then PlotIconMethod draws this icon in the specified destination rectangle, with the specified transform and alignment.

PlotIconMethod passes to your icon getter function the type of the icon to draw and the value specified in the yourDataPtr parameter. The PlotIconMethod function examines the current bit depth of the display devices and calls your icon getter function once for each display device that intersects the rectangle specified in the parameter theRect. Your icon getter function should return a handle to the requested icon's data. Your icon getter function can get the icon data using whatever method is appropriate to your application. For example, your application might maintain its own cache of icons or use its icon getter function to get an icon from the desktop database.

RESULT CODES
noErr0No error
noMaskFoundErr-1000No mask found
SEE ALSO
For more information about icon getter functions, see page 5-58.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996