Important: The information in this document is obsolete and should not be used for new development.
LoadIconCache
You can use theLoadIconCache
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 theLoadIconCache
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). TheLoadIconCache
function uses the same criteria asPlotIconSuite
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, andLoadIconCache
adds the returned handle to the entry for that icon in the icon cache.After calling
LoadIconCache
, you can pass the same parameters toPlotIconSuite
to plot the icon data. Note that if you specify an alignment when you callLoadIconCache
, then callPlotIconSuite
and specify no alignment,PlotIconSuite
draws the icon using the alignment that you originally specified toLoadIconCache
.RESULT CODES
noErr 0 No error noMaskFoundErr -1000 No mask found SEE ALSO
For a description of thePlotIconSuite
function, see page 5-35.