vs2017 c++ mfc利用CimageDC 类 截屏显示保存文件 CWindowDC winDC(pWnd); pWnd->GetWindowRect(&rect); int nBPP = winDC.GetDeviceCaps(BITSPIXEL) * winDC.GetDeviceCaps(PLANES); if (nBPP < 24) { nBPP = 24; } bStat = image.Create(rect.Width() rect.Height() nBPP); ASSERT(bStat); //断言 CImageDC imageDC(image); ::BitBlt(imageDC00 rect.Width() rect.Height() winDC00 SRCCOPY); //填充数据