Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CDC::SelectPalette

Selects the logical palette that is specified by pPalette as the selected palette object of the device context.

CPalette* SelectPalette( 
   CPalette* pPalette, 
   BOOL bForceBackground  
);
pPalette

Identifies the logical palette to be selected. This palette must already have been created with the CPalette member function CreatePalette.

bForceBackground

Specifies whether the logical palette is forced to be a background palette. If bForceBackground is nonzero, the selected palette is always a background palette, regardless of whether the window has the input focus. If bForceBackground is 0 and the device context is attached to a window, the logical palette is a foreground palette when the window has the input focus.

A pointer to a CPalette object identifying the logical palette replaced by the palette specified by pPalette. It is NULL if there is an error.

The new palette becomes the palette object used by GDI to control colors displayed in the device context and replaces the previous palette.

An application can select a logical palette into more than one device context. However, changes to a logical palette will affect all device contexts for which it is selected. If an application selects a palette into more than one device context, the device contexts must all belong to the same physical device.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.