void CaDialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CBitmap b;
CRect rect;
b.LoadBitmap(IDB_BITMAP1);
BITMAP bm;
b.GetBitmap(&bm);
int w=bm.bmWidth;
int h=bm.bmHeight;
CWnd *pWnd=GetDlgItem(IDC_LIST1);
CDC *pControlDC=pWnd->GetDC();
pWnd->Invalidate();
pWnd->UpdateWindow();
pWnd->GetClientRect(&rect);
ScreenToClient(&rect);
pControlDC->CreateCompatibleDC( pControlDC);
pControlDC->SelectObject(&b);
pControlDC->BitBlt(rect.left,rect.top,w,h,pControlDC,0,0,SRCCOPY);
// Do not call CDialog::OnPaint() for painting messages
}
哪位帮我看看为什么在列表框里面显示不了位图呢?会的话可以说的详细点吗?谢了!
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CBitmap b;
CRect rect;
b.LoadBitmap(IDB_BITMAP1);
BITMAP bm;
b.GetBitmap(&bm);
int w=bm.bmWidth;
int h=bm.bmHeight;
CWnd *pWnd=GetDlgItem(IDC_LIST1);
CDC *pControlDC=pWnd->GetDC();
pWnd->Invalidate();
pWnd->UpdateWindow();
pWnd->GetClientRect(&rect);
ScreenToClient(&rect);
pControlDC->CreateCompatibleDC( pControlDC);
pControlDC->SelectObject(&b);
pControlDC->BitBlt(rect.left,rect.top,w,h,pControlDC,0,0,SRCCOPY);
// Do not call CDialog::OnPaint() for painting messages
}
哪位帮我看看为什么在列表框里面显示不了位图呢?会的话可以说的详细点吗?谢了!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货