void CDialogbar::OnPaint()
{
CPaintDC dc(this); // device context for painting
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
BITMAP bp;
bmp.GetBitmap(&bp);
if (bmp.m_hObject)
{
bmp.DeleteObject();
}
CDC dcCompatible;
dcCompatible.CreateCompatibleDC(&dc);
dcCompatible.SelectObject(&bmp);
CRect rect;
GetDlgItem(IDC_LIST1)->GetWindowRect(&rect);
ScreenToClient(&rect);
dc.StretchBlt(rect.left,rect.top,rect.Width(),rect.Height(),&dcCompatible,0,0,bp.bmWidth,bp.bmHeight,SRCCOPY);
((CListBox*)GetDlgItem(IDC_LIST1))->AddString("huang");
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/110052.html
上一篇:Qt軟體打包問題
