Hi!
Does any one know an algoritm to scale an image, by keeping the aspect ratio.
The image has dimension (PWidth, PHeight), and I want to scale it to the dimension (DimWidth, DimHeight).
If the (PWidth, PHeight) are less then (DimWidth, DimHeight) than don't do any scale
otherwise scale the image to (DimWidth, DimHeight).
This meean that the (DimWidth, DimHeigh) are always less then (PWidth, PHeight).
The original image is given as a matrix of pixels.
Bogdan
Algoritm for scale an image!
-
- Plugin Guru
- Posts: 3363
- Joined: Fri Mar 08, 2002 1:00 am
- Location: The Plugin Site
- Contact: