BeginWaitCursor();
    m_dibFile.UsePalette(pDC);     //  message handlers, not here
    CSize sizeFileDib = m_dibFile.GetDimensions();
    sizeFileDib.cx *= 30;
    sizeFileDib.cy *= -30;
    m_dibFile.Draw(pDC,CPoint(0,0), sizeFileDib);
    EndWaitCursor();
========================================================================
    sizeFileDib.cx *= 30;
    sizeFileDib.cy *= -30;
这两句必须要有么?为什么不能删掉呢?
CSize中没有这样的东西啊,不解。
还有
BeginWaitCursor();
.......
EndWaitCursor();有什么特殊的用途么?

解决方案 »

  1.   

    BeginWaitCursor(); 显示沙漏等待光标
    EndWaitCursor();恢复正常的光标显示
      

  2.   

    BeginWaitCursor就是将鼠标设置成沙漏状,这样,就可以告诉用户:现在程序正在进行复杂的操作,需要一定时间,但不是死机,请等待windows就是这样的,你应该见过吧?
    EndWaitCursor就是恢复成正常的鼠标状态,表示复杂操作已经做完了。
      

  3.   

    BeginWaitCursor();
    Call this function to display the cursor as an hourglass when you expect a command to take a noticeable time interval to executeEndWaitCursor();
    Call this function after you have called the BeginWaitCursor member function to return from the hourglass cursor to the previous cursor
      

  4.   

    看程序可以知道,应该是一个图像放大显示的程序。
    CSize sizeFileDib = m_dibFile.GetDimensions();
        sizeFileDib.cx *= 30;
        sizeFileDib.cy *= -30;
    sizeFileDib是原始图像的尺寸,放大30倍以后进行显示。
      

  5.   

    首先肯定是不要乘以30,另外,具体的还要看你的Draw函数是怎么做的
      

  6.   

    不放大的话,Draw中应该用BitBlt函数。放大的话,应该使用StretchBlt 函数。你看一下吧。
      

  7.   

    用的是StretchDIBits
    不知道是不是StretchBlt  啊===========================================================================
    BOOL CDib::Draw(CDC* pDC, CPoint origin, CSize size)
    {
    if(m_lpBMIH == NULL) return FALSE;
    if(m_hPalette != NULL) {
    ::SelectPalette(pDC->GetSafeHdc(), m_hPalette, TRUE);
    }
    pDC->SetStretchBltMode(COLORONCOLOR);
    ::StretchDIBits(pDC->GetSafeHdc(), origin.x, origin.y, size.cx, size.cy,
    0, 0, m_lpBMIH->biWidth, m_lpBMIH->biHeight,
    m_lpImage, (LPBITMAPINFO) m_lpBMIH, DIB_RGB_COLORS, SRCCOPY);
    return TRUE;
    }
    怎么样?