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 Resources That Don't Belong to an Icon Family


You can use GetCIcon to get a handle to a color icon of resource type 'cicn'.

FUNCTION GetCIcon (iconID: Integer): CIconHandle;
The resource ID for an icon of resource type 'cicn'.
The GetCIcon function reads in the 'cicn' resource with the specified resource ID and returns a handle to it. The GetCIcon function searches the current resource chain for the resource. If GetCIcon finds the resource, it reads the resource, creates a color icon record for the icon, and initializes the fields of the record according to the information contained in the 'cicn' resource. GetCIcon returns a handle to the color icon record as its function result. If GetCIcon can't find the resource, it returns NIL as its function result.

To draw an icon obtained from GetCIcon in a specified rectangle, you can use either the PlotCIcon or PlotCIconHandle routine. Unlike PlotCIcon, PlotCIconHandle allows you to specify transforms and alignments.

When you are finished with a handle obtained from GetCIcon, use the DisposeCIcon procedure to release the memory occupied by the color icon record.

noErr0No error
resNotFound-192Resource not found
For information about the color icon record, see "The Color Icon Record" on
page 5-17. For information about the format of the 'cicn' resource, see Inside Macintosh: Imaging with QuickDraw.

For descriptions of the PlotCIcon procedure and PlotCIconHandle function, see page 5-20 and page 5-26, respectively. The DisposeCIcon procedure is described next.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996