Important: The information in this document is obsolete and should not be used for new development.
GetCIcon
You can useGetCIconto get a handle to a color icon of resource type'cicn'.
FUNCTION GetCIcon (iconID: Integer): CIconHandle;
iconID- The resource ID for an icon of resource type
'cicn'.DESCRIPTION
TheGetCIconfunction reads in the'cicn'resource with the specified resource ID and returns a handle to it. TheGetCIconfunction searches the current resource chain for the resource. IfGetCIconfinds 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.GetCIconreturns a handle to the color icon record as its function result. IfGetCIconcan't find the resource, it returnsNILas its function result.To draw an icon obtained from
GetCIconin a specified rectangle, you can use either thePlotCIconorPlotCIconHandleroutine. UnlikePlotCIcon,PlotCIconHandleallows you to specify transforms and alignments.When you are finished with a handle obtained from
GetCIcon, use theDisposeCIconprocedure to release the memory occupied by the color icon record.RESULT CODES
noErr 0 No error resNotFound -192 Resource not found SEE ALSO
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
PlotCIconprocedure andPlotCIconHandlefunction, see page 5-20 and page 5-26, respectively. TheDisposeCIconprocedure is described next.