Method: UIImage#scale_to
- Defined in:
-
lib/sugarcube-image/uiimage.rb,
lib/sugarcube-image/uiimage.rb
Scales an image to fit within the given size. Its current aspect ratio is maintained, but the image is padded so that it fills the entire area. If the image is too small, it will be scaled up to fit. If you specify a background that color will be used, otherwise the background will be transparent.
217 218 219 |
# File 'lib/sugarcube-image/uiimage.rb', line 217 def scale_to(new_size) scale_to(new_size, background:nil) end |