I'll clearly define the two ratios first.
ImageRatio = WidthOfImage / HeightOfImage
andWindowRatio = WidthOfPreviewPane / HeightOfPreviewPane
.Second, you may try your windows explorer again. When the
WindowRatio
is smaller than theImageRatio
and you drag the pane vertically, the height of the preview pane will also change.Finally, you may get
ActualWidthOfImage
andActualHeightOfImage
as below:if (WindowRatio > ImageRatio) { ActualHeightOfImage = HeightOfPreviewPane; ActualWidthOfImage = ActualHeightOfImage * ImageRatio; } else { ActualWidthOfImage = WidthOfPreviewPane; ActualHeightOfImage = ActualWidthOfImage / ImageRatio; }
Am I understand your problem correctly? I'd like to help you if you got further questions.