构造器和说明 |
---|
ImageUtil() |
限定符和类型 | 方法和说明 |
---|---|
static byte[] |
cutAndCompress(File srcImage,
String formatName,
int containerWidth,
int containerHeight,
int clippedX,
int clippedY,
int clippedWidth,
int clippedHeight)
图片剪切压缩
|
static byte[] |
cutAndCompress(String srcFilePath,
String formatName,
int containerWidth,
int containerHeight,
int clippedX,
int clippedY,
int clippedWidth,
int clippedHeight)
图片剪切压缩
|
static void |
resize(String srcImageFilename,
String destImageFilename,
int maxWidth,
int maxHeight)
重新改变图片的尺寸,保持原有比率不变
|
public static void resize(String srcImageFilename, String destImageFilename, int maxWidth, int maxHeight) throws IOException
srcImageFilename
- destImageFilename
- maxWidth
- maxHeight
- IOException
public static byte[] cutAndCompress(File srcImage, String formatName, int containerWidth, int containerHeight, int clippedX, int clippedY, int clippedWidth, int clippedHeight) throws IOException
srcImage
- 源图片formatName
- 格式名称(JPG|JPEG|PNG)containerWidth
- 用来展示源图片的区域的宽度containerHeight
- 用来展示源图片的区域的高度clippedX
- 剪切区域的x坐标clippedY
- 剪切区域的y坐标clippedWidth
- 剪切区域的宽度clippedHeight
- 剪切区域的高度IOException
public static byte[] cutAndCompress(String srcFilePath, String formatName, int containerWidth, int containerHeight, int clippedX, int clippedY, int clippedWidth, int clippedHeight) throws IOException
srcFilePath
- 源图片路径(文件名)formatName
- 格式名称(JPG|JPEG|PNG)containerWidth
- 用来展示源图片的区域的宽度containerHeight
- 用来展示源图片的区域的高度clippedX
- 剪切区域的x坐标clippedY
- 剪切区域的y坐标clippedWidth
- 剪切区域的宽度clippedHeight
- 剪切区域的高度IOException
Copyright © 2016–2018. All rights reserved.