Get a site

VC++ 6.0 ebook chapter index
Free counters!

Chapter 16

The Palette Manager

This chapter would not exist were it not for a hardware deficiency. Although many modern video adapter boards offer 24-bit color (also known as "true color" or "millions of colors") or 16-bit color ("high color" or "thousands of colors"), some video adapters—particularly on laptops or in high-resolution video modes—allow only 8 bits per pixel. The use of 8 bits per pixel implies only 256 simultaneous colors.

What can we do with 256 colors? While a mere 16 colors are clearly inadequate for displaying real-world images and the use of thousands or millions of color is quite sufficient for that task, 256 colors falls somewhere in the middle. Yes, 256 colors are adequate for displaying a real-world image, but only if those colors are selected specifically for the particular image. This means that an operating system simply cannot choose a "standard" set of 256 colors and expect them to be the ideal colors for every application.

This is what the Windows Palette Manager is all about. It's for specifying the colors that your program needs when running in an 8-bit video mode. If you know that your programs will never run in 8-bit video modes, you won't need to use the Palette Manager. However, this chapter contains important information nonetheless, for it ties up some loose ends with bitmaps.