如何从 CPaintDC 图像(屏幕)到 Cimage?
CPaintDC dc(this);
dc.FillSolidRect( 20-1, 200+1, 200*3, 400+2, (COLORREF) 0x0 );
dc.SelectObject(pen1);
dc.MoveTo(20,400);
for(int i = 0;i<200;i++)
{
dc.LineTo(20 + x[i], 600 - y1[i]);
dc.FillSolidRect( 20 + x[i]-1,600- y1[i]-1, 3, 3, (COLORREF) 0xff00 );
}
(下面会输出一条警告消息,说明它触发了关于“dbgrptt.c - 调试 CRT 报告功能”的断点???所以我一定是错过了或做错了什么?
CImage myimage;
myimage.GetDC();
myimage.Save("C:\\Projects_example\\sweep.jpg");
myimage.ReleaseDC();