Compartir a través de


StretchDIBits (Windows CE 5.0)

Send Feedback

This function copies the color data for a rectangle of pixels in a DIB to the specified destination rectangle.

If the destination rectangle is larger than the source rectangle, this function stretches the rows and columns of color data to fit the destination rectangle.

If the destination rectangle is smaller than the source rectangle, this function compresses the rows and columns by using the specified raster operation.

WINGDIAPI BOOL WINAPI StretchDIBits(HDChdc,intXDest,intYDest,intnDestWidth,intnDestHeight,intXSrc,intYSrc,intnSrcWidth,intnSrcHeight,CONST VOID* lpBits,CONST BITMAPINFO* lpBitsInfo,UINTiUsage,DWORDdwRop);

Parameters

  • hdc
    [in] Handle to the destination device context.

  • XDest
    [in] Integer that specifies the x-coordinate, in logical units, of the upper left corner of the destination rectangle.

  • YDest
    [in] Integer that specifies the y-coordinate, in logical units, of the upper left corner of the destination rectangle.

  • nDestWidth
    [in] Integer that specifies the width, in logical units, of the destination rectangle.

  • nDestHeight
    [in] Integer that specifies the height, in logical units, of the destination rectangle.

  • XSrc
    [in] Integer that specifies the x-coordinate, in pixels, of the origin of the source rectangle in the DIB.

  • YSrc
    [in] Integer that specifies the y-coordinate, in pixels, of the origin of the source rectangle in the DIB.

  • nSrcWidth
    [in] Integer that specifies the width, in pixels, of the source rectangle in the DIB.

  • nSrcHeight
    [in] Integer that specifies the height, in pixels, of the source rectangle in the DIB.

  • lpBits
    [in] Pointer to the DIB bits, which are stored as an array of bytes.

  • lpBitsInfo
    [in] Pointer to a BITMAPINFO structure that contains information about the DIB.

  • iUsage
    [in] Unsigned integer that specifies whether you provided a value for the bmiColors member of the BITMAPINFO structure, and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or indexes.

    The following table shows the possible values.

    Value Description
    DIB_PAL_COLORS The array contains 16-bit indexes into the logical palette of the source device context.
    DIB_RGB_COLORS The color table contains literal red, green, and blue values.
  • dwRop
    [in] DWORD that specifies how to combine the source pixels, the current brush of the destination device context, and the destination pixels to form the new image.

Return Values

Nonzero indicates success.

Zero indicates failure.

To get extended error information, call GetLastError.

Remarks

The origin of a bottom-up DIB is the bottom-left corner; the origin of a top-down DIB is the upper-left corner.

StretchDIBits creates a mirror image of a bitmap if the signs of the nSrcWidth and nDestWidth parameters differ, or if the signs of the nSrcHeight and nDestHeight parameters differ.

If nSrcWidth and nDestWidth have different signs, the function creates a mirror image of the bitmap along the x-axis.

If nSrcHeight and nDestHeight have different signs, the function creates a mirror image of the bitmap along the y-axis.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Windows.h.
Link Library: Coredll.lib.

See Also

BITMAPINFO

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.