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 / Working With Icon Caches


LoadIconCache

You can use the LoadIconCache function to load into an icon cache a handle to the appropriate icon data for a specified destination rectangle and the current bit depth, for drawing later with a specified alignment and transform.

FUNCTION LoadIconCache (theRect: Rect; align: IconAlignmentType;
                        transform: IconTransformType;
                        theIconCache: Handle): OSErr;
theRect
The rectangle in which to draw the icon, specified in local coordinates of the current graphics port. LoadIconCache uses the rectangle specified in this parameter and the bit depth of the display device to determine which icon type to load into the cache.
align
A value that specifies how to align the icon within the rectangle. See the description of PlotIconSuite on page 5-35 for a list of constants you can use in this parameter.
transform
A value that specifies how to modify the appearance of the icon. See the description of PlotIconSuite beginning on page 5-35 for a list of constants you can use in this parameter.
theIconCache
A handle to the icon cache into which to load the icon data.
DESCRIPTION
You can load icon data into an icon cache with the LoadIconCache function for drawing at a later time. For example, this can be useful if you suspect that the icon may be drawn at a time not convenient for loading resource data (for instance, when the resource fork isn't in the current resource chain). The LoadIconCache function uses the same criteria as PlotIconSuite to select the icon to load.

LoadIconCache uses the icon getter function associated with the icon cache to get the appropriate icon. The icon getter function returns a handle to the requested icon data, and LoadIconCache adds the returned handle to the entry for that icon in the icon cache.

After calling LoadIconCache, you can pass the same parameters to PlotIconSuite to plot the icon data. Note that if you specify an alignment when you call LoadIconCache, then call PlotIconSuite and specify no alignment, PlotIconSuite draws the icon using the alignment that you originally specified to LoadIconCache.

RESULT CODES
noErr0No error
noMaskFoundErr-1000No mask found
SEE ALSO
For a description of the PlotIconSuite function, see page 5-35.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996