先用内存绘图试试
Graphics g(pDC->m_hDC); CRect rcClient; GetClientRect(&rcClient); Bitmap bmp(rcClient.Width(), rcClient.Height()); Graphics * buffergraphics = Graphics::FromImage(&bmp);//关键部分,创建一个内存图像 SolidBrush brush(Color(255, 0,0, 255)); buffergraphics ->FillRectangle(&brush,0, 0, rcClient.Width(),rcClient.Height()); //在内存图像中画图 g.DrawImage(&bmp,0, 0, rcClient.Width(), rcClient.Height());//将内存图像显示到屏幕 delete buffergraphics ; g.ReleaseHDC(pDC->m_hDC);
实在还有问题,可能还需要对绘制的窗口无效矩形区域控制