位图的均匀分割(error),need help
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,temp;
10 BITMAP bm;
11 bitmap.GetObject(sizeof(BITMAP),&bm);
12 int m_nWidth=bm.bmWidth;
13 int m_nHeight=bm.bmHeight;
14 dc.SelectObject(bitmap);
15 temp.CreateCompatibleBitmap(mdc,m_nWidth/2,m_nHeight);
16 mdc->SelectObject(&temp);
17 bitmap.LoadBitmap(IDB_BITMAP1);
18 mdc->SelectObject(bitmap);
19
20 mdc->BitBlt(0,0,m_nWidth/2,m_nHeight,&dc,0,0,SRCCOPY);
21 delete mdc;
22 }
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,temp;
10 BITMAP bm;
11 bitmap.GetObject(sizeof(BITMAP),&bm);
12 int m_nWidth=bm.bmWidth;
13 int m_nHeight=bm.bmHeight;
14 dc.SelectObject(bitmap);
15 temp.CreateCompatibleBitmap(mdc,m_nWidth/2,m_nHeight);
16 mdc->SelectObject(&temp);
17 bitmap.LoadBitmap(IDB_BITMAP1);
18 mdc->SelectObject(bitmap);
19
20 mdc->BitBlt(0,0,m_nWidth/2,m_nHeight,&dc,0,0,SRCCOPY);
21 delete mdc;
22 }