当鼠标移动,绘图到DC,同时绘图到CMetaFileDC,算是备份。
重绘时把CMetaFileDC的内容弄到DC上去(最终还需要保存为文件)如果不是用GDI+的Graphics对象,而是用CDC的MoveTo和LineTo则OK代码如下:
Pen myPen2(Color(GetRValue(m_PenColor),GetGValue(m_PenColor),GetBValue(m_PenColor)),1);
Graphics myGraphics2(m_MeataFile.m_hDC);
myGraphics2.DrawLine……