public class ImageRescaler extends java.lang.Object
| Constructor and Description |
|---|
ImageRescaler() |
| Modifier and Type | Method and Description |
|---|---|
static java.awt.image.BufferedImage |
rescaleToRect(java.awt.image.BufferedImage original,
int maxWidth,
int maxHeight,
boolean enlarge)
Rescales an image so that is fits to the specified rectangle (without changing the
aspect ratio).
|
public ImageRescaler()
public static java.awt.image.BufferedImage rescaleToRect(java.awt.image.BufferedImage original, int maxWidth, int maxHeight, boolean enlarge)
original - the original imagemaxWidth - the width of the rectangle (the widht of the returned image
will be smaller or equal to maxWidth)maxHeight - the height of the rectangle (the height of the returned image
will be smaller or equal to maxHeight)enlarge - determines whether the image should be enlarged if it is smaller
than the specified rectangle or if the original size shall be returned