13.07.2015 Views

REFERENCE GUIDE

REFERENCE GUIDE

REFERENCE GUIDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 2.4Palette manager colormappingalgorithmin the system palette. To further aid this color matching, Windowssets aside 20 static colors (called the "default palette") in thesystem palette to which it can match entries in a backgroundpalette.Windows always satisfies the color requests of the foregroundwindow first; this ensures that the active window will have thebest color display possible. For the remaining windows, Windowssatisfies the color requests of the window which most recentlyreceived input focus, the window which was active before thatone, and so on.aSystem Palette Logical Palette 1(Active Window)2 _.. 3-----_._---.....43 54675Logical Palette 26a7 18239 45A 67B8a12Figure 2.4 illustrates this process. In this figure, a hypotheticaldisplay has a system palette capable of containing 12 colors. Theapplication that created Logical Palette 1 owns the active windowand was the first to realize its logical palette, which consists of 8colors. Logical Palette 2 is owned by a window which realized itslogical palette while it was inactive.Because the active window was active when it realized its palette,Windows mapped all of the colors in Logical Palette 1 directly tothe system palette.Three of the colors (1,3, and 5) in Logical Palette 2 are identical tocolors in the system palette; to save space in the palette, then,Windows simply matched those colors to the existing systemcolors when the second application realized its palette. Colors 0,2,Chapter 2, Graphics device interface functions 97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!