Image scaling by Width & Height constant - preserve aspect ratio



Hi,

I'm looking for an algorithm to resize an image of arbitrary size to a
"fixed" / required width and height.

For example, my application requires that images be no larger than 440 pixel
(height) x 780 (wide)

So the "preferred size" would be 440 x 780

If an image is too large, either by width or height it should be resized
until less than or equal to 440 x 780 and preserve aspect ratio.

Thanks for any tips.

Farce


.



Relevant Pages

  • Re: barcode
    ... The same algorithm I used in an ASP page and it worked. ... If you want to generate CODE 39, POSTNET, i25 barcodes: ... For the 250 to 290 that means 40 extra pixels ... , if it gives it to the printer to resize ...
    (comp.lang.php)
  • Re: Resize algorithm implemented in GDI
    ... I used every known interpolant filter I know in the spacial domain and none of them reaches its sharpness so I'm starting to think it's a filter working in the frequency domain... ... It looks like a trivial nearest neighbour algorithm. ... It explains it sharpness as well as it's low quality (take any 256 color image and resize it to see how really terrible this algorithm is). ...
    (microsoft.public.win32.programmer.gdi)
  • How to modify size of dialog while in OnSize()?
    ... ratio. ... I can run my algorithm in the OnSizeto determine the correct size ... while in OnSize(), OnSizeis called again and I'm in an infinite loop. ... wait for the mouse button to be released and then resize, ...
    (microsoft.public.vc.mfc)
  • Re: How to modify size of dialog while in OnSize()?
    ... > ratio. ... I can run my algorithm in the OnSizeto determine the correct ... > while in OnSize(), OnSizeis called again and I'm in an infinite loop. ... > wait for the mouse button to be released and then resize, ...
    (microsoft.public.vc.mfc)
  • Re: resolution for printing?
    ... I'm currently cropping some images using the marquee and its fixed ... > 4 x 6 based on the ratio. ... If you are really unsure of print settings there is a wizard to resize the ...
    (comp.graphics.apps.photoshop)