public Method

Image.resize_to_fit(cols, rows)

Convenience method to resize retaining the aspect ratio. (Thanks to Robert Manni!)

Source Code

# File RMagick.rb, line 920
def resize_to_fit(cols, rows)
    change_geometry(Geometry.new(cols, rows)) do |ncols, nrows|
        resize(ncols, nrows)
    end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.