Share via


Gdi::StretchBlt_I (Windows Embedded CE 6.0)

1/6/2010

This method copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary.

Windows Embedded CE stretches or compresses the bitmap according to the stretching mode set in the destination device context.

Syntax

static WINGDIAPI BOOL WINAPI StretchBlt_I(
  HDC hdcDest, 
  int nXOriginDest, 
  int nYOriginDest, 
  int nWidthDest, 
  int nHeightDest, 
  HDC hdcSrc, 
  int nXOriginSrc, 
  int nYOriginSrc, 
  int nWidthSrc, 
  int nHeightSrc, 
  DWORD dwRop
);

Parameters

  • hdcDest
    [in] Handle to the destination device context.
  • nXOriginDest
    [in] Integer that specifies the x-coordinate, in logical units, of the upper left corner of the destination rectangle.
  • nYOriginDest
    [in] Integer that specifies the y-coordinate, in logical units, of the upper left corner of the destination rectangle.
  • nWidthDest
    [in] Integer that specifies the width, in logical units, of the destination rectangle.
  • nHeightDest
    [in] Integer that specifies the height, in logical units, of the destination rectangle.
  • hdcSrc
    [in] Handle to the source device context.
  • nXOriginSrc
    [in] Integer that specifies the x-coordinate, in logical units, of the upper left corner of the source rectangle.
  • nYOriginSrc
    [in] Integer that specifies the y-coordinate, in logical units, of the upper left corner of the source rectangle.
  • nWidthSrc
    [in] Integer that specifies the width, in logical units, of the source rectangle.
  • nHeightSrc
    [in] Integer that specifies the height, in logical units, of the source rectangle.
  • dwRop
    [in] DWORD that specifies the raster operation to be performed.

    Raster operation codes define how the system combines colors in output operations that involve a brush, a source bitmap, and a destination bitmap.

    See Gdi::BitBlt_I for a list of common raster operation codes.

Return Value

Nonzero indicates success.

Zero indicates failure.

To get extended error information, call GetLastError.

Remarks

This method is an internal version of the StretchBlt function.

Gdi::StretchBlt_I stretches or compresses the source bitmap in memory and then copies the result to the destination rectangle. The color data for pattern or destination pixels is merged after the stretching or compression occurs.

If the specified raster operation requires a brush, the system uses the brush currently selected into the destination device context.

The destination coordinates are transformed by using the transformation currently specified for the destination device context; the source coordinates are transformed by using the transformation currently specified for the source device context.

If the source transformation has a rotation or shear, an error occurs.

If destination, source, and pattern bitmaps do not have the same color format, Gdi::StretchBlt_I converts the source and pattern bitmaps to match the destination bitmap.

If Gdi::StretchBlt_I must convert a monochrome bitmap to a color bitmap, Gdi::StretchBlt_I sets white bits (1) to the background color and black bits (0) to the foreground color.

To convert a color bitmap to a monochrome bitmap, Gdi::StretchBlt_I sets pixels that match the background color to white (1) and sets all other pixels to black (0). The foreground and background colors of the device context with color are used.

Gdi::StretchBlt_I creates a mirror image of a bitmap if the signs of the nWidthSrc and nWidthDest parameters or of the nHeightSrc and nHeightDest parameters differ.

If nWidthSrc and nWidthDest have different signs, the method creates a mirror image of the bitmap along the x-axis.

If nHeightSrc and nHeightDest have different signs, the method creates a mirror image of the bitmap along the y-axis.

Not all devices support the Gdi::StretchBlt_I function. For more information, see the Gdi::GetDeviceCaps_I method.

Requirements

Header gdi.hpp
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Gdi
StretchBlt
Gdi::BitBlt_I
Gdi::GetDeviceCaps_I
Gdi::MaskBlt_I