BOOL StretchBlt ( int x,//The x-coordinate of the upper-left corner of the specified destination rectangle area int y,//y-coordinate of the upper-left corner of the specified destination rectangle area int nwidth,//width of the specified destination rectangle area int nheight,//height of the specified destination rectangle area cdc* PSRCDC, int XSRC,//Specifies the x-coordinate of the upper-left corner of the source rectangular area int YSRC,//Specifies the y-coordinate of the upper-left corner of the source rectangular area int Nsrcwidth,//Specifies the width of the source rectangle area int Nsrcheight,//Specifies the height of the source rectangle area DWORD Dwrop//This parameter reference msdn,srccopy type is direct copy ); This function copies a bitmap resource from one rectangular region to another, that is, a scaled bitmap BOOL TransparentBlt ( int Xdest, int Ydest, int Ndestwidth, int Ndestheight, cdc* PSRCDC, int XSRC, int YSRC, int Nsrcwidth, int Nsrcheight, UINT clrtransparent ); This function also has a zoom function, but the last parameter of this function is used to specify RGB as a transparent color;
BOOL BitBlt ( int x, int y, int nwidth, int nheight, cdc* PSRCDC, int XSRC, int YSRC, DWORD Dwrop ); This function is also used to copy bitmap resources, but does not have the zoom function.
Examples of usage: CPAINTDC DC (this); CBitmap backbmp; BACKBMP.LOADBITMAPW (IDB_BITMAP1); BITMAP BM; Backbmp.getbitmap (&BM); CDC Imagedc; Imagedc.createcompatibledc (&DC); cbitmap* poldimagebmp = Imagedc.selectobject (&backbmp); dc. StretchBlt (0, 0, bm.bmwidth+15, bm.bmheight+15, &imagedc, 0, 0, bm.bmwidth, Bm.bmheight, srccopy); Imagedc.selectobject (poldimagebmp); CBitmap forebmp; FOREBMP.LOADBITMAPW (IDB_BITMAP2); Forebmp.getbitmap (&BM); Poldimagebmp = Imagedc.selectobject (&forebmp); dc. TransparentBlt (0, 0, bm.bmwidth+15, bm.bmheight+15, &imagedc, 0, 0, bm.bmwidth, bm.bmheight, RGB (255, 255, 255)); Imagedc.selectobject (poldimagebmp); (Weiqubo) |