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 / Getting Icons From an Icon Suite


GetIconFromSuite

You can use the GetIconFromSuite function to get an icon from an icon suite.

FUNCTION GetIconFromSuite (VAR theIconData: Handle; 
                           theSuite: Handle;
                           theType: ResType): OSErr;
theIconData
GetIconFromSuite returns a handle to the data for the requested icon in this parameter. If an icon of the specified type does not exist in the given icon suite, GetIconFromSuite returns NIL in this parameter.
theSuite
A handle to the icon suite from which to get the icon.
theType
The resource type of the desired icon.
DESCRIPTION
The GetIconFromSuite function returns a handle to the data for the icon of type theType in the icon suite specified by theSuite. If you intend to dispose of the handle, pass a NIL handle to the AddIconToSuite function to delete the corresponding entry in the suite.

You can use the handle returned by GetIconFromSuite to manipulate the icon data, for example, to alter its color or add three-dimensional shading. However, you should not use the returned handle to draw the icon with other Icon Utilities routines.

IMPORTANT
To plot an icon from an icon suite, you should normally use PlotIconSuite. The PlotIconHandle function may not draw the icon correctly if you pass it the handle returned in the theIconData parameter of GetIconFromSuite.
RESULT CODES
noErr0No error
paramErr-50Requested type not present in suite
SEE ALSO
For an example of the use of the GetIconFromSuite function, see Listing 5-4 on page 5-13.

For a description of the AddIconToSuite function, see page 5-33. The PlotIconSuite function is described next.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996