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();有什么特殊的用途么?
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();有什么特殊的用途么?
EndWaitCursor();恢复正常的光标显示
EndWaitCursor就是恢复成正常的鼠标状态,表示复杂操作已经做完了。
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
CSize sizeFileDib = m_dibFile.GetDimensions();
sizeFileDib.cx *= 30;
sizeFileDib.cy *= -30;
sizeFileDib是原始图像的尺寸,放大30倍以后进行显示。
不知道是不是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;
}
怎么样?