public final class ImageUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
changeImge(File img,
int width,
int height)
* 转换图片大小,不变形
|
static void |
format(String orgImgFile,
int width,
int height,
String suffixName,
String targetFile)
图片格式转换
|
static void |
scale(BufferedImage orgImg,
double scale,
String targetFile)
根据比例缩放图片
|
static void |
scale(String orgImgFile,
double scale,
String targetFile) |
static double |
scaleHeight(BufferedImage orgImg,
int targetHeight,
String targetFile)
根据高度同比缩放
|
static void |
scaleHeight(String orgImgFile,
int targetHeight,
String targetFile) |
static double |
scaleWidth(BufferedImage orgImg,
int targetWidth,
String targetFile)
根据宽度同比缩放
|
static void |
scaleWidth(File file,
Integer width) |
static void |
scaleWidth(String orgImgFile,
int targetWidth,
String targetFile) |
public static final void changeImge(File img, int width, int height)
img - 图片文件width - 图片宽height - 图片高public static final void scale(BufferedImage orgImg, double scale, String targetFile) throws IOException
orgImg - 源图片路径scale - 比例targetFile - 缩放后的图片存放路径IOExceptionpublic static final void scale(String orgImgFile, double scale, String targetFile) throws IOException
IOExceptionpublic static final void format(String orgImgFile, int width, int height, String suffixName, String targetFile) throws IOException
orgImgFile - width - height - suffixName - targetFile - IOExceptionpublic static final double scaleWidth(BufferedImage orgImg, int targetWidth, String targetFile) throws IOException
orgImg - 源图片targetWidth - 缩放后的宽度targetFile - 缩放后的图片存放路径IOExceptionpublic static final void scaleWidth(String orgImgFile, int targetWidth, String targetFile) throws IOException
IOExceptionpublic static final double scaleHeight(BufferedImage orgImg, int targetHeight, String targetFile) throws IOException
orgImg - 源图片targetHeight - 缩放后的高度targetFile - 缩放后的图片存放地址IOExceptionpublic static final void scaleHeight(String orgImgFile, int targetHeight, String targetFile) throws IOException
IOExceptionpublic static final void scaleWidth(File file, Integer width) throws IOException
IOExceptionCopyright © 2017. All rights reserved.