Important: The information in this document is obsolete and should not be used for new development.
GetCIcon
You can useGetCIcon
to 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
TheGetCIcon
function reads in the'cicn'
resource with the specified resource ID and returns a handle to it. TheGetCIcon
function searches the current resource chain for the resource. IfGetCIcon
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. IfGetCIcon
can't find the resource, it returnsNIL
as its function result.To draw an icon obtained from
GetCIcon
in a specified rectangle, you can use either thePlotCIcon
orPlotCIconHandle
routine. UnlikePlotCIcon
,PlotCIconHandle
allows you to specify transforms and alignments.When you are finished with a handle obtained from
GetCIcon
, use theDisposeCIcon
procedure 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
PlotCIcon
procedure andPlotCIconHandle
function, see page 5-20 and page 5-26, respectively. TheDisposeCIcon
procedure is described next.