如题。

解决方案 »

  1.   

    为了防止程序失去响应,可以设置定时器,隔段时间显示一部分。
    另外,在定时器中保存当前的现实位置,在OnDraw中重绘,效果较好。
      

  2.   

    怎么我用了sleep后,只会显示最后一张
      

  3.   

    > 怎么我用了sleep后,只会显示最后一张GDI may cache the drawing. To flush caching, call GetPixel after each drawing call.But the right method is to use either a thread or timer message. You can redraw outside of WM_PAINT message handling. For example:CView::OnTimer()
    {
        if (m_CurrentFrame < m_MaxFrame)
        {
            HDC hDC = GetDC(m_hWnd);
            // draw frame m_CurrentFrame
            ReleaseDC(m_hWnd, hDC);
        }
        else
        {
            m_CurrentFrame ++;
        }
    }
      

  4.   

    加载WM_TIMER会生成OnTimer()函数,在合适的地方用SetTimer(1,1000,NULL);1000就是指1秒运行一次。这个时间你可以自己修改,SetTimer会调用OnTimer。你在OnTimer里使用Invalidate调用OnDraw,可以把显示图片的部分放在这里这个就像动画,很多书上都有这方面资料的
      

  5.   

    用多媒体计时器,然后把绘画的动作放在线程中。每隔一段时间,event会被激发一次。渐显可以试试AlphaBlend。