解决图像裁剪后图像dpi不正确

This commit is contained in:
yangjiaxuan 2023-03-01 17:17:36 +08:00
parent e4990ab7e4
commit 2a113d52ec
1 changed files with 5 additions and 0 deletions

View File

@ -2862,6 +2862,10 @@ void MainWindow::on_act_autoCrop_triggered()
return;
}
HGUInt xDpi = 0;
HGUInt yDpi = 0;
HGBase_GetImageDpi(img, &xDpi, &yDpi);
Dialog_ImgProc_AutoCrop dlg(this);
if (dlg.exec())
{
@ -2916,6 +2920,7 @@ void MainWindow::on_act_autoCrop_triggered()
imgInfo.type, HGBASE_IMGORIGIN_TOP, &destImage);
if (nullptr != destImage)
{
HGBase_SetImageDpi(destImage, xDpi, yDpi);
m_view->addImage(destImage);
HGBase_DestroyImage(destImage);
m_modify = true;