override OnPaint()call
      DIBShow(dib0,IDC_MAP2,0,0);

解决方案 »

  1.   

    我现在的OnPaint函数这样的
    void CMyBitMapDlg::OnPaint() 
    {
    if (IsIconic())
    {
    CPaintDC dc(this); // device context for painting // 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
    {
    SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); CDialog::OnPaint();
    }
    }
    你代码的位置不对
      

  2.   

    if里面的代码只会在初始化的时候执行一次,要放到else里,再加一行CPaintDC dc(this);