16,472
社区成员
发帖
与我相关
我的任务
分享
if (pDoc->m_pImage)
{
int cxPage = pDC->GetDeviceCaps(HORZRES);
int cyPage = pDC->GetDeviceCaps(VERTRES);
int cxInch = pDC->GetDeviceCaps(LOGPIXELSX);
int cyInch = pDC->GetDeviceCaps(LOGPIXELSY);
int cx = cxPage-200;
int cy = (int)(((double)pDoc->m_pImage->GetHeight()*cyInch*cx)
/((double)pDoc->m_pImage->GetWidth()*cxInch));
Graphics graphics(pDC->GetSafeHdc());
graphics.SetInterpolationMode(InterpolationModeHighQualityBicubic);
graphics.DrawImage(pDoc->m_pImage, Rect(100, 100, cx, cy));
}