Question Resize image while mantaining the aspect rasio

inkedgfx

Well-known member
Joined
Sep 29, 2012
Messages
139
Location
USA
Programming Experience
Beginner
I want to constrain the proportions of an image while resizing. I have two radio buttons on my form , I want to be able to resize an image while constraining either from the width or height of the image.so the user picks either constrain from the width or from the height....anyone know where to start with this?

InkedGFX
 
Not sure how you'd execute it, but I would think the math involved would be dividing the original X by the original Y then store that value. So if the image was 100 by 50 for example, you'd get 2. Then if they resize X to 200, you'd divide that by the aspect you calculated (200 / 2 = 100) and resize Y to 100, resulting in a 200 by 100 image.
 
Back
Top