B2017-155 Round the wdith when saving the Image Size

This commit is contained in:
Rich 2017-08-01 14:01:15 +00:00
parent a223b72423
commit 2b7ac6131b

View File

@ -823,8 +823,9 @@ namespace Volian.Controls.Library
imgCfg = new ImageConfig();
else if (imgCfg == null)
imgCfg = new ImageConfig(MyItemInfo.MyContent.MyImage);
imgCfg.Image_Width = (int)(_newSizeWd / (MyStepPanel.DPI / 72f));
imgCfg.Image_Height = (int)(_newSizeHt / (MyStepPanel.DPI / 72f));
// B2017-155 Round the value by adding .51F
imgCfg.Image_Width = (int)(.51F + _newSizeWd / (MyStepPanel.DPI / 72f));
imgCfg.Image_Height = (int)(.51F + _newSizeHt / (MyStepPanel.DPI / 72f));
if (compressed) imgCfg.Image_DataSize = origLen;
_MyItem.MyContent.MyImage.Config = imgCfg.ToString();
}