int GetStretchBltMode(hdc) | |||||
HDC hdc; | /* handle of device context | */ |
The GetStretchBltMode function retrieves the current bitmap-stretching mode. The bitmap-stretching mode defines how information is removed from bitmaps that were compressed by using the StretchBlt function.
hdc
Identifies the device context.
The return value specifies the current bitmap-stretching mode—STRETCH_ANDSCANS, STRETCH_DELETESCANS, or STRETCH_ORSCANS—if the function is successful.
The STRETCH_ANDSCANS and STRETCH_ORSCANS modes are typically used to preserve foreground pixels in monochrome bitmaps. The STRETCH_DELETESCANS mode is typically used to preserve color in color bitmaps. For more information, see the SetStretchBltMode function.
The following example uses the GetStretchBltMode function to determine whether the current bitmap-stretching mode is STRETCH_DELETESCANS; if so, it uses the StretchBlt function to display a compressed bitmap.
HDC hdcMem;
int nStretchMode;
nStretchMode = GetStretchBltMode(hdc);
if (nStretchMode == STRETCH_DELETESCANS) {
StretchBlt(hdc, 50, 175, 32, 32, hdcMem, 0, 0, 64, 64,
SRCCOPY);
.
.
.
}