19,464
社区成员
发帖
与我相关
我的任务
分享void C**::CaptureScreen( )
{
CClientDC hdcScreen(this);
CRect clientRect;
GetClientRect(&clientRect);
HDC hdcCompatible = CreateCompatibleDC(hdcScreen);
HBITMAP hbmScreen = CreateCompatibleBitmap(hdcScreen,clientRect.Width(),clientRect.Height());
BitBlt(hdcCompatible,0,0,clientRect.Width(),clientRect.Height(),hdcScreen,0,0,SRCCOPY);
//这里就是文档的图像了——hbmScreen
DeleteObject(hbmScreen);
DeleteDC(hdcCompatible);
DeleteDC(hdcScreen);
}