15,979
社区成员
发帖
与我相关
我的任务
分享
CWnd* pWnd;
pWnd=GetDlgItem(IDC_IMAGE1);
CDC* pDC=pWnd->GetDC();
HDC hDC = pDC->m_hDC;
CRect rect_frame;
pWnd->GetClientRect(&rect_frame);
image1.Load(fileName);
::SetStretchBltMode(hDC,HALFTONE);
::SetBrushOrgEx(hDC,0,0,NULL);
image1.Draw(hDC,rect_frame);
ReleaseDC(pDC);//释放picture控件的DC
其中image1是Cimage类的一个对象,IDC_IMAGE1是你的控件的ID