1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
BITMAPINFO bitmapinfo;
memset(&bitmapinfo,0,sizeof(BITMAPINFO));
bitmapinfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
bitmapinfo.bmiHeader.biWidth=bm.bmWidth;
bitmapinfo.bmiHeader.biHeight=bm.bmHeight;
bitmapinfo.bmiHeader.biPlanes=1;
bitmapinfo.bmiHeader.biBitCount=32;
UINT *buff;
myBMP2 = CreateDIBSection(paintDC,
(BITMAPINFO *)&bitmapinfo,
DIB_RGB_COLORS,
(void **)&buff,
NULL, 0);
GetDIBits (paintDC,
myBMP2,
0, bm.bmHeight,
buff,
&bitmapinfo,
DIB_RGB_COLORS
);
SetDIBits (paintDC,
myBMP2,
0, bm.bmHeight,
buff,
&bitmapinfo,
DIB_RGB_COLORS
);
HDC hdcMem = CreateCompatibleDC(paintDC);
SelectObject(hdcMem, myBMP2);
if (!BitBlt(paintDC, pr.tl.x, pr.tl.y, pr.width(), pr.height(),
hdcMem, buf_pos.x, buf_pos.y, SRCCOPY)) |
Partager