public class ImageCompressx extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 构造器和说明 |
|---|
ImageCompressx(byte[] bytes) |
ImageCompressx(File pic) |
ImageCompressx(InputStream input) |
| 限定符和类型 | 方法和说明 |
|---|---|
ImageCompressx |
addWatermarkPic(BufferedImage icon,
int x,
int y)
文件水印(图片)
|
ImageCompressx |
addWatermarkPic(BufferedImage icon,
int x,
int y,
int a)
文件水印(图片)
|
ImageCompressx |
addWatermarkText(String text,
int x,
int y)
添加水印文字
|
ImageCompressx |
cutPic(CutConfig cutConfig)
图片裁剪
|
String |
getFormat() |
int |
getHeight() |
BufferedImage[] |
getImg() |
int |
getType() |
int |
getWidth() |
ImageCompressx |
jhlabs_filter(com.jhlabs.image.AbstractBufferedImageOp jhlabs) |
String |
toBase64()
获取 Base64
|
byte[] |
writeImageByte(String formatName)
写入 byte[]
|
void |
writeImageFile(File outputfile)
写入文件
|
void |
writeImageFileCompress(File outputfile)
写入文件并压缩质量
|
InputStream |
writeImageInputStream(String formatName)
写入 InputStream
|
public ImageCompressx(File pic) throws IOException, SimpleImageException
pic - IOExceptionSimpleImageExceptionpublic ImageCompressx(byte[] bytes)
throws IOException,
SimpleImageException
bytes - IOExceptionSimpleImageExceptionpublic ImageCompressx(InputStream input) throws IOException, SimpleImageException
input - IOExceptionSimpleImageExceptionpublic BufferedImage[] getImg()
public String getFormat()
public int getWidth()
public int getHeight()
public int getType()
public void writeImageFile(File outputfile) throws IOException
outputfile - IOExceptionpublic InputStream writeImageInputStream(String formatName) throws IOException
formatName - IOExceptionpublic byte[] writeImageByte(String formatName) throws IOException
formatName - IOExceptionpublic void writeImageFileCompress(File outputfile) throws IOException
outputfile - IOExceptionpublic String toBase64() throws IOException
IOExceptionpublic ImageCompressx cutPic(CutConfig cutConfig)
cutConfig - public ImageCompressx jhlabs_filter(com.jhlabs.image.AbstractBufferedImageOp jhlabs)
jhlabs - public ImageCompressx addWatermarkPic(BufferedImage icon, int x, int y)
icon - public ImageCompressx addWatermarkPic(BufferedImage icon, int x, int y, int a)
icon - public ImageCompressx addWatermarkText(String text, int x, int y)
text - Copyright © 2020. All rights reserved.