public class DimensionConstrain extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
DimensionConstrain() |
| Modifier and Type | Method and Description |
|---|---|
static DimensionConstrain |
createAbsolutionDimension(int width,
int height)
Used when the destination size is fixed.
|
static DimensionConstrain |
createMaxDimension(int width,
int height)
Forces the image to keep radio and be keeped within the width and height
|
static DimensionConstrain |
createMaxDimension(int width,
int height,
boolean neverEnlargeImage)
Forces the image to keep radio and be keeped within the width and height.
|
static DimensionConstrain |
createMaxDimensionNoOrientation(int length1,
int length2)
Forces the image to keep radio and be keeped within the width and height.
|
static DimensionConstrain |
createMaxDimensionNoOrientation(int length1,
int length2,
boolean neverEnlargeImage)
Forces the image to keep radio and be keeped within the width and height.
|
static DimensionConstrain |
createRelativeDimension(float fraction)
Used when the destination size is relative to the source.
|
static DimensionConstrain |
createRelativeDimension(float fractionWidth,
float fractionHeight)
Used when the destination size is relative to the source.
|
Dimension |
getDimension(Dimension dimension)
Will always return a dimension with positive width and height;
|
public Dimension getDimension(Dimension dimension)
dimension - of the unscaled imagepublic static DimensionConstrain createAbsolutionDimension(int width, int height)
width - destination dimension widthheight - destination dimension heightpublic static DimensionConstrain createRelativeDimension(float fraction)
fraction - resize fraction (must be a positive number)public static DimensionConstrain createRelativeDimension(float fractionWidth, float fractionHeight)
- public static DimensionConstrain createMaxDimension(int width, int height)
width - height - public static DimensionConstrain createMaxDimension(int width, int height, boolean neverEnlargeImage)
width - height - neverEnlargeImage - if true only a downscale will occourpublic static DimensionConstrain createMaxDimensionNoOrientation(int length1, int length2)
length1 - length2 - public static DimensionConstrain createMaxDimensionNoOrientation(int length1, int length2, boolean neverEnlargeImage)
length1 - length2 - neverEnlargeImage - if true only a downscale will occourCopyright © 2014. All rights reserved.