public class WatermarkUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.slf4j.Logger |
log |
| 构造器和说明 |
|---|
WatermarkUtil() |
WatermarkUtil(float x,
float y) |
WatermarkUtil(int x,
int y) |
| 限定符和类型 | 方法和说明 |
|---|---|
float |
getAlpha() |
Color |
getColor() |
Integer |
getDegree() |
String |
getFontName() |
int |
getFontSize() |
int |
getFontStyle() |
void |
markIcon(File icon,
File src) |
void |
markIcon(File icon,
File src,
File target) |
void |
markIcon(File icon,
int iconWidth,
int iconHeight,
File src,
File target)
给图片添加水印、可设置水印图片旋转角度
|
void |
markIcon(String icon,
String src) |
void |
markIcon(String icon,
String src,
String target) |
void |
markText(String text,
File src) |
boolean |
markText(String text,
File src,
File target)
给图片添加水印、可设置水印的旋转角度
|
void |
markText(String text,
String src) |
void |
markText(String text,
String src,
String target) |
void |
offset(float x,
float y)
水印偏移
|
void |
offset(int x,
int y)
水印偏移
|
void |
setAlpha(float alpha) |
void |
setColor(Color color) |
void |
setDegree(Integer degree) |
void |
setFontName(String fontName) |
void |
setFontSize(int fontSize) |
void |
setFontStyle(int fontStyle) |
public WatermarkUtil()
public WatermarkUtil(int x,
int y)
public WatermarkUtil(float x,
float y)
public boolean markText(String text, File src, File target)
text - 水印文本src - 源文件target - 添加水印后保存至public void markIcon(File icon, int iconWidth, int iconHeight, File src, File target)
icon - 水印图片路径iconWidth - icon宽度iconHeight - icon高度src - 源图片路径target - 目标图片路径public void offset(int x,
int y)
x - xy - ypublic void offset(float x,
float y)
x - x%y - y%public Integer getDegree()
public void setDegree(Integer degree)
public Color getColor()
public void setColor(Color color)
public String getFontName()
public void setFontName(String fontName)
public int getFontStyle()
public void setFontStyle(int fontStyle)
public int getFontSize()
public void setFontSize(int fontSize)
public float getAlpha()
public void setAlpha(float alpha)
Copyright © 2022. All rights reserved.