Compartilhar via


CDC::SetBkMode

Sets the background mode.

int SetBkMode( 
   int nBkMode  
);

Parameters

  • nBkMode
    Specifies the mode to be set. This parameter can be either of the following values:

    • OPAQUE   Background is filled with the current 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.

Remarks

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

Example

See the example for CWnd::OnCtlColor.

Requirements

Header: afxwin.h

See Also

Reference

CDC Class

Hierarchy Chart

CDC::GetBkColor

CDC::GetBkMode

CDC::SetBkColor

SetBkMode