Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than gdi32, prefix the name with the module name and a period.
StretchBlt (gdi32)
.
C# Signature:
[DllImport("gdi32.dll")]
static extern bool StretchBlt(IntPtr hdcDest, int nXOriginDest,
int nYOriginDest, int nWidthDest, int nHeightDest, IntPtr hdcSrc,
int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, uint dwRop);
The last argument uint dwRop from the signature above specifies a raster operation code defined in the header. A value from enum TernaryRasterOperations below can be used as the last argument to fake the defined value from this signature:
[DllImport("gdi32.dll")]
static extern bool StretchBlt(IntPtr hdcDest, int nXOriginDest,
int nYOriginDest, int nWidthDest, int nHeightDest, IntPtr hdcSrc,
int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, TernaryRasterOperations dwRop );
public enum TernaryRasterOperations
{
SRCCOPY = 0x00CC0020, /* dest = source*/
SRCPAINT = 0x00EE0086, /* dest = source OR dest*/
SRCAND = 0x008800C6, /* dest = source AND dest*/
SRCINVERT = 0x00660046, /* dest = source XOR dest*/
SRCERASE = 0x00440328, /* dest = source AND (NOT dest )*/
NOTSRCCOPY = 0x00330008, /* dest = (NOT source)*/
NOTSRCERASE = 0x001100A6, /* dest = (NOT src) AND (NOT dest) */
MERGECOPY = 0x00C000CA, /* dest = (source AND pattern)*/
MERGEPAINT = 0x00BB0226, /* dest = (NOT source) OR dest*/
PATCOPY = 0x00F00021, /* dest = pattern*/
PATPAINT = 0x00FB0A09, /* dest = DPSnoo*/
PATINVERT = 0x005A0049, /* dest = pattern XOR dest*/
DSTINVERT = 0x00550009, /* dest = (NOT dest)*/
BLACKNESS = 0x00000042, /* dest = BLACK*/
WHITENESS = 0x00FF0062, /* dest = WHITE*/
};
Notes:
StretchBlt can be used to create zoom functionality.
Tips & Tricks:
Please add some!
Sample Code:
Performs a simple zoom on an Hbitmap (hbmp)
[DllImport("gdi32.dll")]
static extern bool StretchBlt(IntPtr hdcDest, int nXOriginDest,
int nYOriginDest, int nWidthDest, int nHeightDest, IntPtr hdcSrc,
int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc,
TernaryRasterOperations dwRop );
Used by [BitBlt] to define how the color data for the source rectangle is to be combined with the color data for the destination rectangle to achieve the final color.
5/26/2010 2:34:39 PM - -67.168.202.202
Copies bits from one device context onto another.
12/1/2011 6:55:12 AM - -50.32.51.38
Copies bits from one device context onto another.
12/1/2011 6:55:12 AM - -50.32.51.38
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).