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
Data Structure

The Color Icon Record

The GetCIcon function reads in a color icon resource--that is, an icon resource of type 'cicn'--and returns a handle to a color icon record. A color icon record is defined by the CIcon data type.

   CIcon =
      iconPMap:      PixMap;     {the icon's pixel map}
      iconMask:      BitMap;     {the icon's mask}
      iconBMap:      BitMap;     {the icon's bitmap}
      iconData:      Handle;     {handle to the icon's data}
      iconMaskData:              {the data for the icon's mask}
                     ARRAY[0..0] OF Integer;
   CIconPtr    = ^CIcon;         {pointer to color icon record}
   CIconHandle = ^CIconPtr;      {handle to color icon record}
Field Description
The pixel map describing the icon. Note that this is a pixel map record, not a handle to a pixel map record.
A bitmap of the icon's mask.
A bitmap of the icon.
A handle to the icon's pixel image.
An array containing the icon's mask data followed by the icon's bitmap data. This is used only when the icon is stored as a resource.
Your application can load a color icon resource into memory using the GetCIcon function. All color icon resources should be marked purgeable. To draw a color icon, you can use the PlotCIcon or PlotCIconHandle function. When your application has finished using a color icon, it can dispose of the color icon record by calling the DisposeCIcon function.

You can use icons of resource type 'cicn' in menus the same way that you use resources of type 'ICON'. If a menu item specifies an icon number, the menu definition procedure first tries to load in a 'cicn' resource with the specified resource ID. If it doesn't find one, the menu definition procedure tries to load in an 'ICON' resource with the same ID. The Dialog Manager also uses a 'cicn' resource instead of an 'ICON' resource if it finds one with the same resource ID. For more information, see Inside Macintosh: Macintosh Toolbox Essentials.

For information about the format of a color icon resource, see Inside Macintosh: Imaging with QuickDraw.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996