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 Reference /
Chapter 1 - Palette Manager Reference /
Palette Manager Functions / Manipulating Palettes and Color Tables


CTab2Palette

Copies the colors of a color table into a palette.

pascal void CTab2Palette(
CTabHandle srcCTab,
PaletteHandle dstPalette,
short srcUsage,
short srcTolerance);
srcCTab
A handle to the color table whose colors are to be copied. Color tables are described in the chapter "Color QuickDraw" of Inside Macintosh: Imaging With QuickDraw.
dstPalette
The palette to receive the colors.
srcUsage
A usage constant to be assigned the palette entries. Usage constants are described in "Usage Constants" (page 1-3).
srcTolerance
A tolerance value to be assigned the palette entries.
DISCUSSION
The CTab2Palette function copies the fields from an existing color-table structure into an existing palette structure. If the structures are not the same size, then CTab2Palette resizes the palette structure to match the number of entries in the color-table structure. If the palette in dstPalette has any entries allocated for animation on any screen device, they are relinquished before the new colors are copied. The srcUsage and srcTolerance parameters are the value that you assign to the new colors.

If you want to use color-table animation, you can use AnimateEntry (page 1-20) and AnimatePalette (page 1-21) to change the colors in a palette and on corresponding devices. Changes made to a palette by CTab2Palette don't take effect until the next ActivatePalette function is performed. If either the color-table handle or the palette handle is nil, CTab2Palette does nothing.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996