Okay, I finally think I understand. Your 4/3 had me confused as your aspect ratio (width / height) when it is not.
Your example works as follows:
Image width = 626 px
Image height = 932 px
Screen width = 600 px
Screen Height = 800 px
So the problem is you need to scale the image height down to fit the screen height and then keeping the same aspect ratio, figure out what percentage of your screen width to use.
So 800 / 932 is how much you need to scale (multiply by) to get your height to 800 px (100%).
Your new width to keep the same aspect ratio means you must multiply your image width by the same factor:
626 * (800 / 932)
This is in pixels, to convert that to % of screen width have to divide it by the screen width:
which gives after regrouping terms:
(626 / 932) * (800 / 600) which equals (626/932) * (4/3)
So 4/3 was not your screen aspect ratio but its inverse.
Now what you are trying to do all makes sense!
Last edited by KevinH; 07-26-2017 at 08:56 AM.
|