MFC PictureControl显示各种格式图片

CImage image
CWnd* pWnd;
pWnd=GetDlgItem(IDC_IMAGE1);
CDC* pDC=pWnd->GetDC();
HDC  hDC = pDC->m_hDC;
 
CRect rect_frame;
pWnd->GetClientRect(&rect_frame);
image.Load(fileName);
 
 
::SetStretchBltMode(hDC,HALFTONE);
::SetBrushOrgEx(hDC,0,0,NULL);
 
image.Draw(hDC,rect_frame);
ReleaseDC(pDC); //释放picture控件的DC
image.Destroy();

【转自http://bbs.csdn.net/topics/390825165】

你可能感兴趣的:(MFC PictureControl显示各种格式图片)