freeimage

Freeimage.scale aspect ratio


How do you keep the aspect ratio with FreeImage.scale to fit a desired width or height? I know because it will scale proportionally, I will have to pick either width or height and let the other one be calculated. But I dont see a method for zoom or setting the aspect ratio to be constant when I scale it. Thanks.


Solution

  • enter image description here

    Aspect ratio is as simple as height divided by width, Let H = 600 and W = 800 then AR(Aspect Ratio) = 600/800. For the image resize by specifying three parameters, please reference to the image above.