Method: Magick::Image#resize_to_fill!
- Defined in:
- lib/RMagick.rb
permalink #resize_to_fill!(ncols, nrows = nil, gravity = CenterGravity) ⇒ Object Also known as: crop_resized!
[View source]
998 999 1000 1001 1002 1003 1004 1005 1006 |
# File 'lib/RMagick.rb', line 998 def resize_to_fill!(ncols, nrows=nil, gravity=CenterGravity) nrows ||= ncols if ncols != columns || nrows != rows scale = [ncols/columns.to_f, nrows/rows.to_f].max resize!(scale*columns+0.5, scale*rows+0.5) end crop!(gravity, ncols, nrows, true) if ncols != columns || nrows != rows self end |