Put the :
Invalidate();
UpdateWindow();
StretchBlt();
in the OnPaint()
You should move the StretchBlt() into the Onpaint()

解决方案 »

  1.   

    CBitmap bmp;
    bmp.LoadPicture()Bitblt()
      

  2.   

    我移到OnPaint()里面了,但是还是没反应?
      

  3.   

    用LoadBitMap
      Bitblt()
    就可以了
      

  4.   

    in CMyDlg::OnPaint()
    {
    CPictureHolder picHolder;
    picHolder.CreateFromBitmap(bhm_ddb);
    //get render and bound rect......picHolder.Render(pDC,rcRender, rcWBounds);
    }
      

  5.   

    简单而没问题的代码:(使用256色位图测试)
    void CDlgDlg::OnPaint() 
    {
    if (IsIconic())
    {
    CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle
    int cxIcon = GetSystemMetrics(SM_CXICON);
    int cyIcon = GetSystemMetrics(SM_CYICON);
    CRect rect;
    GetClientRect(&rect);
    int x = (rect.Width() - cxIcon + 1) / 2;
    int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon
    dc.DrawIcon(x, y, m_hIcon);
    }
    else
    {
    CBitmap bmp;
    if(!bmp.LoadBitmap(IDB_BITMAP1))
    return;
    BITMAP bm;
    bmp.GetObject(sizeof(BITMAP),&bm);
    CPaintDC dc(this);
    CDC mem;
    if(!mem.CreateCompatibleDC(&dc))
    return;
    CBitmap *pOld =(CBitmap *)mem.SelectObject(&bmp);
    dc.BitBlt(0,0,bm.bmWidth,bm.bmHeight,&mem,0,0,SRCCOPY);
    mem.SelectObject(pOld);
    CDialog::OnPaint();
    }
    }
    如果还有问题,再联系
      

  6.   

    将CStatic* m_pic; 定义为对话框的类变量。
    再试试!