public class ImageUtils extends Object
| Constructor and Description |
|---|
ImageUtils() |
| Modifier and Type | Method and Description |
|---|---|
int |
getAspectRatio(InputStream inputStream)
获取图片的宽高比
|
InputStream |
resize(InputStream inputStream,
int newWidth,
int newHeight,
boolean forceResize)
改变图片分辨率
|
void |
resize(InputStream inputStream,
OutputStream outputStream,
int newWidth,
int newHeight,
boolean forceResize)
改变图片分辨率
|
public InputStream resize(InputStream inputStream, int newWidth, int newHeight, boolean forceResize) throws IOException
inputStream - 输入流newWidth - 新的宽newHeight - 新的高forceResize - 是否强制宽高IOException - 文件输出异常public void resize(InputStream inputStream, OutputStream outputStream, int newWidth, int newHeight, boolean forceResize) throws IOException
inputStream - 输入流outputStream - 输出流newWidth - 新的宽newHeight - 新的高forceResize - 是否强制宽高IOException - 文件输出异常public int getAspectRatio(InputStream inputStream) throws IOException
inputStream - 输入流IOException - 文件异常Copyright © 2021 Clouds Studio. All rights reserved.