Bool stretchblt (
Int X, // specifies the X coordinate in the upper-left corner of the destination rectangle.
Int y, // specifies the Y coordinate in the upper-left corner of the target rectangle.
Int nwidth, // specify the width of the area of the target rectangle
Int nheight, // specify the height of the destination rectangle
CDC * psrcdc,
Int xsrc, // specify the X coordinate in the upper left corner of the source rectangle area
Int ysrc, // specifies the Y coordinate in the upper left corner of the source rectangle area.
Int nscwidth, // specify the width of the source rectangle area
Int nscheight, // specify the height of the source rectangular area
DWORD dwdrop // For details about this parameter, refer to msdn. The srccopy type is direct copy.
); // This function copies a bitmap resource from one rectangle area to another, that is, the scaled bitmap.
Bool transparentblt (
Int xdest,
Int ydest,
Int ndestwidth,
Int ndestheight,
CDC * psrcdc,
Int xsrc,
Int ysrc,
Int nscwidth,
Int nscheight,
Uint clrtransparent
); // This function also has the zoom function, but the last parameter of this function is used to specify the RGB color as the 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 support scaling.
Example:
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 );