TImage32.ScaleToFit

procedure ScaleToFit(width, height: integer);


Scales the image so that it fits inside the specified dimensions, while also preserving image geometry. Unless the supplied width and height exactly match the image's geometry, the new image will have either it's height or it's width matching the supplied values.