MFC中使用CImage显示缩略图的方法

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

你可能感兴趣的:(VC/MFC)