VC 显示位图(OnDraw() define)

 1 void CActOView::OnDraw(CDC* pDC)
 2 {
 3     CActODoc* pDoc = GetDocument();
 4     ASSERT_VALID(pDoc);
 5     // TODO: add draw code for native data here
 6     CClientDC dc(this);
 7     CDC *mdc=new CDC;
 8     mdc->CreateCompatibleDC(&dc);
 9     CBitmap bitmap;
10     bitmap.LoadBitmap(IDB_BITMAP1);
11     mdc->SelectObject(bitmap);
12     CRect rect;
13     GetClientRect(&rect);
14     pDC->BitBlt(0,0,rect.right,rect.bottom,mdc,0,0,SRCCOPY);
15     delete mdc;
16 }
posted @ 2009-09-27 10:53  soderman  阅读(369)  评论(0编辑  收藏  举报