用位圖當背景之後背景圖片不能隨對話框變大變小,背景圖片是平鋪了,如何實現拉伸,謝謝大神
CWnd* pWnd;
pWnd=GetDlgItem(IDC_IMAGE1);
CDC* pDC=pWnd->GetDC();
HDC hDC = pDC->m_hDC;
CRect rect_frame;
CImage image;
pWnd->GetClientRect(&rect_frame);
image.Load(fileName);
::SetStretchBltMode(hDC,HALFTONE);
::SetBrushOrgEx(hDC,0,0,NULL);
image.Draw(hDC,rect_frame);
ReleaseDC(pDC);//釋放picture控件的DC
直接這樣,圖片會自動適應窗口大小