From a7fe3e00eed7b71be0e693b913a7fd65a3f5f4eb Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Wed, 19 Jul 2023 14:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8twain=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E5=9B=BE=E5=83=8F=EF=BC=8Cdpi=E5=B0=911=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/base/HGImage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/base/HGImage.cpp b/modules/base/HGImage.cpp index ef94d80d..02718195 100644 --- a/modules/base/HGImage.cpp +++ b/modules/base/HGImage.cpp @@ -558,8 +558,8 @@ static HGResult LoadGdiImage(Gdiplus::Image* pImage, const HGImageRoi* roi, HGUI if (HGBASE_ERR_OK == ret) { - HGUInt xDpi = (HGUInt)pImage->GetHorizontalResolution(); - HGUInt yDpi = (HGUInt)pImage->GetVerticalResolution(); + HGUInt xDpi = (HGUInt)((double)pImage->GetHorizontalResolution() + 0.5); + HGUInt yDpi = (HGUInt)((double)pImage->GetVerticalResolution() + 0.5); HGBase_SetImageDpi(*image, xDpi, yDpi); }