SetBkMode

  int SetBkMode(hdc, iBkMode)    
  HDC hdc;    
  int iBkMode;    

The SetBkMode function sets the background mode used with text, line styles, and hatched brushes. The background mode defines whether or not existing background colors should be removed on the device surface before drawing text, hatched brushes, or any pen style that is not a solid line.

Parameters

hdc

Identifies the device context.

iBkMode

Specifies the background mode. It can be either one of the following modes:

Value Meaning

OPAQUE  
  Background is filled with the current background color before the text, hatched brush, or pen is drawn.
TRANSPARENT  
  Background remains untouched.

Return Value

The return value specifies the previous background mode. It will be 0 if an error occurred.

Comments

This function sets the line styles for lines drawn with a pen that was created using the CreatePen function; it does not affect lines drawn with a pen that was created using the ExtCreatePen function.

See Also

CreatePen, SetBkColor