Function:
StretchBlt(hDestDC, x, y, nWidth, nHeight, hSrcDC, xSrc, ySrc, nSrcWidth, nSrcHeight, dwFlag)

 

Description:
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 stretches or compresses the bitmap according to the stretching mode currently set in the destination device context.

 

Parameters:
hDestDC: The device context of the target window.
x: The x coordinate of the point to put the image inside the target
y: The ycoordinate of the point to put the image inside the target
nWidth: The width of the image piece in the target.
nHeight: The height of the image piece in the target.
hSrcDC: The device context of the source window.
xSrc: The x coordinate to the upper-left corner of the image piece in the source.
ySrc: The y coordinate to the upper-left corner of the image piece in the source.
nSrcWidth: The width of the image piece in the source.
nSrcHeight The height of the image piece in the source:
dwFlag: Flag to specify the method used to copy the image, (can be any of the following):
BLACKNESS = 66
Fill the destination rectangle with the colour whose index is 0 in
the physical palette (black by default).
DSTINVERT = 5570569
Invert the colours in the destination rectangle.
MERGECOPY = 12583114
Merge the colours of the source rectangle with the specified pattern
using the bitwise AND operator.
MERGEPAINT = 12255782
Merge the colours of the inverted source rectangle with the colours of the destination rectangle using the bitwise OR operator.
NOTSRCCOPY = 3342344
Copy the inverted source rectangle to the destination rectangle.
NOTSRCERASE = 1114278
Combine the colours of the source and destination rectangles using the bitwise OR operator and then invert the resulting colour.
PATCOPY = 15728673
Copy the specified pattern into the destination bitmap.
PATINVERT = 5898313
Combine the colours of the specified pattern with the colours of the
destination rectangle using the bitwise XOR operator.
PATPAINT = 16452105
Combine the colours of the specified pattern with the colours of the
inverted source rectangle using the bitwise OR operator. Combine the
result of that operation with the colours of the destination rectangle
using the bitwise OR operator.
SRCAND = 8913094
Combine the colours of the source and destination rectangles using the bitwise AND operator.
SRCCOPY = 13369376
Copy the source rectangle directly into the destination rectangle.
SRCERASE = 4457256
Combine the inverted colours of the destination rectangle with the colours of the source rectange using the bitwise AND operator.
SRCINVERT = 6684742
Combine the colours of the source and destination rectangles using the bitwise XOR operator.
SRCPAINT = 15597702
Combine the colours of the source and destination rectangles using the bitwise OR operator.
WHITENESS = 16711778
Fill the destination rectangle with the colour whose index is 1 in the physical palette (white by default).

 

Returns:
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.

 

Example:
Select the icon to download the sample stretchblt.a5p. A useful tool that magnifies the pixels beneath the cursor.