> Hi,
>
[quoted text clipped - 12 lines]
>
> Farce
Ok,
if the ratio is lower than 780/440 (your fixed width split on the fixed
height), then you need to resize by height, if it is (equal to
or(equality can be put in either one of the two methods)) higher than
this one, then it should be resized by width...
So:
double fixedRatio = 780.0/440.0;
if((double)image.getWidth()/image.getHeight >= fixedRatio)
{
resizeImage( image, 780, image.getHeight()/(image.getWidth()/780.0) );
// This requires that there exists a resizeImage method, but I don't
know what you want, drawImage or if you are making a file or what, so
this is kind of pseudo-code.
}
else
{
resizeImage( image, image.getWidth()/(image.getHeight()/440.0), 440);
}
I think that should do it, but I'm kind of tired right now...