mfc对话框如何显示缩略图,求教

2024-12-05 01:19:37
推荐回答(1个)
回答(1):

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