Important: The information in this document is obsolete and should not be used for new development.
GetIcon
You can use theGetIcon
function 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
TheGetIcon
function reads in the'ICON'
resource with the specified resource ID and returns a handle to it. TheGetIcon
function searches the current resource chain for the resource. IfGetIcon
finds the resource, it reads the resource and returns a handle to the icon as its function result. IfGetIcon
can't find the resource, it returnsNIL
as its function result.To draw an icon obtained from
GetIcon
in a specified rectangle, you can use eitherPlotIcon
orPlotIconHandle
. UnlikePlotIcon
,PlotIconHandle
allows you to specify transforms and alignments.When you are finished using a handle obtained from
GetIcon
, use theReleaseResource
procedure 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 thePlotIcon
procedure andPlotIconHandle
function, see page 5-23 and page 5-24, respectively. For information aboutReleaseResource
, see the chapter "Resource Manager" in this book.