please dont rip this site Prev Next

StretchDIBits info  Overview  Group

The StretchDIBits function copies the color data for a rectangle of pixels in a device-independent bitmap (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.

int StretchDIBits(

    HDC hdc,

// handle of device context

    int XDest,

// x-coordinate of upper-left corner of dest. rect.

    int YDest,

// y-coordinate of upper-left corner of dest. rect.

    int nDestWidth,

// width of destination rectangle

    int nDestHeight,

// height of destination rectangle

    int XSrc,

// x-coordinate of upper-left corner of source rect.

    int YSrc,

// y-coordinate of upper-left corner of source rect.

    int nSrcWidth,

// width of source rectangle

    int nSrcHeight,

// height of source rectangle

    CONST VOID *lpBits,

// address of bitmap bits

    CONST BITMAPINFO *lpBitsInfo,

// address of bitmap data

    UINT iUsage,

// usage

    DWORD dwRop 

// raster operation code

   );

Parameters

hdc
Identifies the destination device context.
XDest
Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
YDest
Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
nDestWidth
Specifies the width, in logical units, of the destination rectangle.
nDestHeight
Specifies the height, in logical units, of the destination rectangle.
XSrc
Specifies the x-coordinate, in pixels, of the source rectangle in the DIB.
YSrc
Specifies the y-coordinate, in pixels, of the source rectangle in the DIB.
nSrcWidth
Specifies the width, in pixels, of the source rectangle in the DIB.
nSrcHeight
Specifies the height, in pixels, of the source rectangle in the DIB.
lpBits
Points to the DIB bits, which are stored as an array of bytes.
lpBitsInfo
Points to a BITMAPINFO structure that contains information about the DIB.
iUsage
Specifies whether the bmiColors member of the BITMAPINFO structure was provided and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or indices. The iUsage parameter must be one of the following values:

Value

Description

DIB_PAL_COLORS

The array contains 16-bit indices into the logical palette of the source device context.

DIB_RGB_COLORS

The color table contains literal RGB values.

dwRop
Specifies how the source pixels, the destination device context’s current brush, and the destination pixels are to be combined to form the new image.

Return Values

If the function succeeds, the return value is the number of scan lines copied.

If the function fails, the return value is GDI_ERROR. 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, or 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.

See Also

SetMapMode, SetStretchBltMode, BITMAPINFO 

See:


file: /Techref/os/win/api/win32/func/src/f87_7.htm, 7KB, , updated: 2001/6/26 09:53, local time: 2024/11/10 09:07,
TOP NEW HELP FIND: 
3.144.116.253:LOG IN
©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://linistepper.com/Techref/os/win/api/win32/func/src/f87_7.htm"> StretchDIBits</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?