GetStretchBltMode

2.x

  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.

Parameters

hdc

Identifies the device context.

Return Value

The return value specifies the current bitmap-stretching mode—STRETCH_ANDSCANS, STRETCH_DELETESCANS, or STRETCH_ORSCANS—if the function is successful.

Comments

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.

Example

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);
        .
        .
        .
}

See Also

SetStretchBltMode, StretchBlt