void CProView::OnDraw(CDC* pDC)
{
聽CProDoc* pDoc = GetDocument();
聽ASSERT_VALID(pDoc);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////璐村浘
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
// Select the bitmap into the in-memory DC
CBitmap* pOldBitmap = dcMemory.SelectObject(&bitmap);
聽// Find a centerpoint for the bitmap in the client area
聽RECT rect;
聽GetClientRect(&rect);
聽// Copy the bits from the in-memory DC into the on-
聽// screen DC to actually do the painting. Use the centerpoint
聽// we computed for the target offset.
聽pDC->BitBlt(0, 0, rect.right, rect.bottom, &dcMemory,0, 0, SRCCOPY);
聽dcMemory.SelectObject(pOldBitmap);
}