Important: The information in this document is obsolete and should not be used for new development.
GetIcon
You can use theGetIconfunction to get a handle to an icon resource of type'ICON'.
FUNCTION GetIcon (iconID: Integer): Handle;
iconID- The resource ID for an icon of resource type
'ICON'.DESCRIPTION
TheGetIconfunction reads in the'ICON'resource with the specified resource ID and returns a handle to it. TheGetIconfunction searches the current resource chain for the resource. IfGetIconfinds the resource, it reads the resource and returns a handle to the icon as its function result. IfGetIconcan't find the resource, it returnsNILas its function result.To draw an icon obtained from
GetIconin a specified rectangle, you can use eitherPlotIconorPlotIconHandle. UnlikePlotIcon,PlotIconHandleallows you to specify transforms and alignments.When you are finished using a handle obtained from
GetIcon, use theReleaseResourceprocedure to release the memory occupied by the icon resource data.RESULT CODES
noErr 0 No error resNotFound -192 Resource not found SEE ALSO
For a description of thePlotIconprocedure andPlotIconHandlefunction, see page 5-23 and page 5-24, respectively. For information aboutReleaseResource, see the chapter "Resource Manager" in this book.