松鼠的博客

导航

截屏操作

OnInitDialog中:
// TODO: Add extra initialization here
CDC dc;
CBitmap *pBmp = NULL;
dc.CreateDC("DISPLAY", NULL, NULL, NULL);

pMemDC = new CDC;
if (!pMemDC)
return FALSE;
pMemDC->CreateCompatibleDC(&dc);

pBmp = new CBitmap;
if (!pBmp)
return FALSE;
pBmp->CreateCompatibleBitmap(&dc, 1024, 768);
pMemDC->SelectObject(pBmp);
ShowWindow(SW_HIDE);

pMemDC->BitBlt(0, 0, 1024, 768, &dc, 0, 0, SRCCOPY);

dc.DeleteDC();
pBmp->DeleteObject();
delete pBmp;
OnPaint中:
CPaintDC dc(this);
dc.BitBlt(0,0,1024, 768, pMemDC, 0, 0, SRCCOPY);

posted on 2008-08-26 13:51  Xproer-松鼠  阅读(305)  评论(0)    收藏  举报