public class ImageUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
adjustForXYDPI(RasterMaster snowImage)
This method resizes an image that has an X-DPI that is different the Y-DPI.
|
static int |
getAdjustedHeightForYDPI(RasterMaster snowImage)
Returns height of image adjusted to match the X-DPI (instead of the Y-DPI).
|
static Dimension |
getThumbnailSize(int maxDimension,
int imageWidth,
int imageHeight,
int xDPI,
int yDPI)
Calculate the best dimensions for a thumbnail of a document page with the given width, height, and DPI.
|
static byte[] |
increaseBytes(byte[] inByte)
Return a new byte array with the same contents, double the size of the original.
|
static byte[] |
trimBytes(byte[] inByte,
int realSize)
Trim provided array to the provided size.
|
public static Dimension getThumbnailSize(int maxDimension, int imageWidth, int imageHeight, int xDPI, int yDPI)
maxDimension
- maximum size thumbnail can be scaled to - either width or height, depending on the original image's aspect ratioimageWidth
- original image's widthimageHeight
- original image's heightxDPI
- horizontal dots per inchyDPI
- vertical dots per inchpublic static boolean adjustForXYDPI(RasterMaster snowImage)
snowImage
- RasterMaster object containing the image to scalepublic static int getAdjustedHeightForYDPI(RasterMaster snowImage)
snowImage
- RasterMaster object containing the image to measurepublic static byte[] increaseBytes(byte[] inByte)
inByte
- byte array to copy and doublepublic static byte[] trimBytes(byte[] inByte, int realSize)
inByte
- array to trimrealSize
- size to trim array toCopyright © 2019 Snowbound Software Corporation. All rights reserved.