CDC::SetBkMode

This method sets the background mode. The background mode defines whether the system removes background colors on the drawing surface before drawing text, hatched brushes, or any pen style that is not a solid line.

int SetBkMode(
int nBkMode ); 

Parameters

  • nBkMode
    The mode to set. This parameter can be either of the following values:
    • OPAQUE   Background is filled with the background color before the text, hatched brush, or pen is drawn. This is the default background mode.
    • TRANSPARENT   Background is not changed before drawing.

Return Value

The previous background mode.

Example

See the example for CWnd::OnCtlColor.

See Also

CDC::GetBkColor, CDC::GetBkMode, CDC::SetBkColor