我用InvalidateRect(NULL)进行刷新,虽然是没有痕迹了,但是坐标出现时一闪一闪的,基本看不出来。

解决方案 »

  1.   

    首先确保OnEraseBkg返回True;之后可以在OnPaint或OnDraw之中做界面的整体绘制。部分绘制可能出现类似的问题(记得要使用双缓存)Invalidate(FALSE);可以确保不闪烁。
      

  2.   

    InvalidateRect(NULL)
    不能NULL ,要计算 无效区!
      

  3.   

    我就是简单的用了下面这个函数实现坐标显示
    void CTest10View::OnMouseMove(UINT nFlags, CPoint point) 
    {
    // TODO: Add your message handler code here and/or call default
    CString str;
      str.Format("x=%d, y=%d", point.x, point.y);
      CDC* pDC = GetDC();
    pDC->DrawText(str,CRect((point.x+10),(point.y+10),point.x+100),  (point.y+50)),1);
            InvalidateRect(NULL) 
            CView::OnMouseMove(nFlags, point);
    }
    我水平太菜了,双缓存要怎样实现啊,我看到很多例子都是加载位图的,我只要坐标显示的那个矩形框不闪
      

  4.   

    pDC->FillSolidRect(CRect((point.x+10),(point.y+10),point.x+100),  (point.y+50)),RGB(255,255,255));// 擦除原字符
    pDC->DrawText(str,CRect((point.x+10),(point.y+10),point.x+100),  (point.y+50)),1);
    //不需要这句
     InvalidateRect(NULL);