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: Advanced Color Imaging on the Mac OS /
Chapter 1 - Palette Manager


Using the Palette Manager

To use the Palette Manager you generally do one of the following:

After creating a palette and assigning it to a window, you can do the following:

These tasks are explained in the rest of this chapter. This chapter also describes how and when to dispose of palettes and how to restore the default color table for an application. However, Palette Manager functions are dependent on the availability of Color QuickDraw. Therefore, before calling any of the functions described in the following sections, your application should check for the existence of Color QuickDraw by using the Gestalt function with the gestaltQuickDrawVersion selector. The Gestalt function returns a 4-byte value in its response parameter; the low-order word contains QuickDraw version data. In that low-order word, the high-order byte gives the major revision number and the low-order byte gives the minor revision number. Listed here are the various constants and the versions of QuickDraw that they represent.

/* quickdraw version */
   gestaltOriginalQD = 0x000, /* original 1-bit QD */
   gestalt8BitQD = 0x100,  /* 8-bit color QD */
   gestalt32BitQD = 0x200, /* 32-bit color QD */
   gestalt32BitQD11 = 0x210, /* 32-bit color QDv1.1 */
   gestalt32BitQD12 = 0x220, /* 32-bit color QDv1.2 */
   gestalt32BitQD13 = 0x230, /* System 7: 32-bit color QDv1.3 */
Your application can also use the Gestalt function with the selector gestaltSystemVersion to check for the system software version under which your application is running. The functions SaveFore, RestoreFore, SaveBack, RestoreBack, ResizePalette, and RestoreDeviceClut require System Software version 6.0.5 or greater:


Subtopics
Creating Palettes
Designating a Default Palette for Your Application
Drawing With a Palette's Colors
Animating a Window With a Palette
Disposing of a Palette and Restoring the Color Table
Using Palettes With Offscreen Graphics Worlds

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996