void CMainFrame::OnPaint() 
{
CPaintDC dc(this); // device context for painting

// TODO: Add your message handler code here
CRect rc;
GetClientRect(&rc);
ASSERT(rc!=NULL);
dc.Ellipse(rc); // Do not call CFrameWnd::OnPaint() for painting messages
}

解决方案 »

  1.   

    利用void Invalidate(BOOL bErase = TRUE );
    bErase :Specifies whether the background within the update region is to be erased.
      

  2.   

    能说的详细点吗?我原来用cb写了个 类autocad的二维图形处理系统,现在想用vc写一下,发现有很多问题要解决.);
      

  3.   

    难道你要打印?在OnDraw中不用Invalidate()
      

  4.   

    我看还是在view中好写,这样当窗口移动时,图形不会消失,这里我还要问:onDraw和onPaint有什么区别??也就是什么时候用那一个 呢?