Palette: GDI DirectDraw Palettes Sample

Click to open or copy the files for the Palette sample.

Palette is a basic example that shows how to use DirectDraw palettes.  Four separate DirectDrawPalette objects are created, and they can be attached to the primary surface just by selecting a menu item. Any given palette can be cycled through its red values. You can create the palettes in exclusive mode or not.

See also the DirectX Palette sample.

Building SDK Samples

This sample uses the following keywords:

beginpaint; clienttoscreen; endpaint; getclientrect; getdc; getdevicecaps; getpixel; getwindowrect; loadicon; long2point; messagebeep; messagebox; paletteindex; patblt; releasedc; setwindowpos; showcolor; unreferenced_parameter; winmain; wndproc