|
@@ -126,9 +126,9 @@ public class WatermarkUtil {
|
|
|
//把待加水印的图片读入缓存
|
|
|
BufferedImage bufImg = new BufferedImage(imgWidth, imgHeight, BufferedImage.TYPE_INT_RGB);
|
|
|
//设置字体
|
|
|
- int fontSize = imgWidth / 30;
|
|
|
+ int fontSize = imgWidth / 40;
|
|
|
Font font = new Font("宋体", Font.BOLD, fontSize);
|
|
|
- float registrationCodeX = imgWidth - imgWidth / 1920F * (registrationCode.length() * fontSize / 72F * 96F);
|
|
|
+ double registrationCodeX = imgWidth - (registrationCode.length() * fontSize * 0.56);
|
|
|
//创建输出流
|
|
|
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
|
|
ImageOutputStream imageOutputStream = ImageIO.createImageOutputStream(bs);
|