public class ImageTools extends Object
| 构造器和说明 |
|---|
ImageTools() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
generateQrCode(String content,
int size,
int margin,
OutputStream os)
生成二维码
|
static void |
generateQrCode(String content,
int size,
OutputStream os)
生成二维码
|
static byte[] |
thumbnail(byte[] bytes,
int width,
int height)
生成缩略图
截取图片的中间部分(不产生变形) 如3000x2000生成100x100的缩略图 先截取中间的2000x2000的部分, 再缩小为100x100 |
static byte[] |
thumbnail(InputStream is,
int width,
int height)
生成缩略图
截取图片的中间部分(不产生变形) 如3000x2000生成100x100的缩略图 先截取中间的2000x2000的部分, 再缩小为100x100 |
static void |
thumbnail(InputStream is,
OutputStream os,
int width,
int height)
生成缩略图
截取图片的中间部分(不产生变形) 如3000x2000生成100x100的缩略图 先截取中间的2000x2000的部分, 再缩小为100x100 |
public static byte[] thumbnail(byte[] bytes,
int width,
int height)
throws IOException
width - height - IOExceptionpublic static byte[] thumbnail(InputStream is, int width, int height) throws IOException
width - height - IOExceptionpublic static void thumbnail(InputStream is, OutputStream os, int width, int height) throws IOException
width - 缩放后的宽度, 0表示自动计算height - 缩放后的宽度, 0表示自动计算IOExceptionpublic static void generateQrCode(String content, int size, OutputStream os)
content - 内容size - 尺寸os - 输出流public static void generateQrCode(String content, int size, int margin, OutputStream os)
content - 内容size - 尺寸margin - 边距os - 输出流Copyright © 2020. All rights reserved.