基于对话框的背景图片设置
void CStudentManageDlg::OnPaint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap bmpBackground;
bmpBackground.LoadBitmapW(IDB_BITMAP2);
BITMAP bitmap;
bmpBackground.GetBitmap(&bitmap);
CBitmap* pbmpOld=dcMem.SelectObject(&bmpBackground);
dc.StretchBlt(0,0,rect.Width(),rect.Height(),
&dcMem,0,0,bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
//其他代码
...........................................
}