int GetBkMode(hdc) | |||||
HDC hdc; | /* handle of device context | */ |
The GetBkMode function returns the background mode. 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.
hdc
Identifies the device context.
The return value specifies the current background mode if the function is successful. It can be OPAQUE, TRANSPARENT, or TRANSPARENT1.
The following example determines the current background mode by calling the GetBkMode function. If the mode is OPAQUE, the SetBkMode function sets it to TRANSPARENT.
int nBackMode;
nBackMode = GetBkMode(hdc);
if (nBackMode == OPAQUE) {
TextOut(hdc, 90, 100, "This background mode is OPAQUE.", 31);
SetBkMode(hdc, TRANSPARENT);
}