I have a dynamic picture that could be any arbitrary size. I also have a picture frame, that is 567pixels wide and 360pixels high (pixels can be inches, or any other measurement. I chose pixels for this scenario). The dynamic picture needs to fit within the frame, but at the same time, fit within it at its proper scale. So if the dyanmic picture is 1000pixels x 1000pixels, for it to properly fit to scale in this scenario, it would have to be 360pixels wide x 360pixels high (can't be more than 360 high cause it has to fit in the frame). If I decided to make it 567 x 360 (to fit the frame), then obviously the picture would be stretched, which is a no go.
Can anybody help me with this simple equation?