From dcd5d07d5d648b48f6f04cd79b6e8c5b780dcff7 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 27 二月 2019 16:59:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java | 65 +++++++++++++++-----------------
1 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java
index c080a66..0aed515 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/ImageUtil.java
@@ -446,7 +446,7 @@
font = font.deriveFont(50.0f);
g2d.setFont(font);
g2d.setColor(new Color(229, 0, 93));
-// g2d.drawString("杩斿埄鍒告彁閱掓偍", 312, 1118 + 40);
+ // g2d.drawString("杩斿埄鍒告彁閱掓偍", 312, 1118 + 40);
g2d.setColor(new Color(102, 102, 102));
g2d.drawString("闀挎寜璇嗗埆浜岀淮鐮侀鍙栦紭鎯犲埜", 312, 1118 + 77);
@@ -472,7 +472,7 @@
return null;
}
-
+
/**
* 缁樺埗澶х殑鍟嗗搧鍔ㄦ�佸垎浜浘
*
@@ -527,7 +527,7 @@
}
g2d.setFont(font);
try {
-// g2d.setColor(new Color(153, 153, 153));
+ // g2d.setColor(new Color(153, 153, 153));
// 鐢荤涓�寮�
for (int i = 0; i < goodsList.size(); i++) {
TaoBaoGoodsBrief goods = goodsList.get(i);
@@ -556,14 +556,14 @@
g2d.drawString("楼", 70, 650);
boldFont = boldFont.deriveFont(42.0f);
g2d.setFont(boldFont);
- g2d.drawString(couplePrice+"", 90, 650);
+ g2d.drawString(couplePrice + "", 90, 650);
// 鐢诲師浠�
g2d.setColor(new Color(102, 102, 102));
font = font.deriveFont(24.0f);
g2d.setFont(font);
- String zkPrice = new BigDecimal((couplePrice+"").replace("楼", "")).add(goods.getCouponAmount())
+ String zkPrice = new BigDecimal((couplePrice + "").replace("楼", "")).add(goods.getCouponAmount())
.toString();
g2d.drawString("楼 " + zkPrice, 70, 650 + 33);
@@ -575,12 +575,12 @@
String quanString = "";
BigDecimal withNoZera = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount());
-
+
if (!withNoZera.toString().endsWith("0")) {
-
+
// 鐢诲埜鍙充晶
- BufferedImage quanRight = ImageIO
- .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
+ BufferedImage quanRight = ImageIO.read(
+ ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
quanRight = zoomInImage(quanRight, 12, 60);
g2d.setColor(new Color(241, 66, 66));
g2d.drawImage(quanRight, topX + 630 - quanRight.getWidth(), topY + 630 - quanRight.getHeight(),
@@ -604,8 +604,8 @@
topY + 630 + 42 - quanRight.getHeight());
// 鐢诲埜宸︿晶
- BufferedImage quanLeft = ImageIO
- .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
+ BufferedImage quanLeft = ImageIO.read(
+ ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
quanLeft = zoomInImage(quanLeft, 12, 60);
g2d.drawImage(quanLeft, topX + 630 - quanRight.getWidth() - textLength - quanLeft.getWidth(),
topY + 630 - quanRight.getHeight(), null);
@@ -647,12 +647,12 @@
String quanString = "";
BigDecimal withNoZera = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount());
-
+
if (!withNoZera.toString().endsWith("0")) {
-
+
// 鐢诲埜鍙充晶
- BufferedImage quanRight = ImageIO
- .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
+ BufferedImage quanRight = ImageIO.read(
+ ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
quanRight = zoomInImage(quanRight, 8, 40);
g2d.setColor(new Color(241, 66, 66));
g2d.drawImage(quanRight, topX + 315 - quanRight.getWidth(), topY + 315 - quanRight.getHeight(),
@@ -660,9 +660,9 @@
// 鐢诲埜鐨勫唴瀹�
g2d.setColor(new Color(229, 0, 93));
-
+
quanString = " " + withNoZera + "鍏冨埜 ";
-
+
font = font.deriveFont(24.0f);
g2d.setFont(font);
FontMetrics fm = g2d.getFontMetrics(font);
@@ -678,13 +678,13 @@
topY + 315 + 28 - quanRight.getHeight());
// 鐢诲埜宸︿晶
- BufferedImage quanLeft = ImageIO
- .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
+ BufferedImage quanLeft = ImageIO.read(
+ ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
quanLeft = zoomInImage(quanLeft, 8, 40);
g2d.drawImage(quanLeft, topX + 315 - quanRight.getWidth() - textLength - quanLeft.getWidth(),
topY + 315 - quanRight.getHeight(), null);
}
-
+
}
}
@@ -702,10 +702,10 @@
if (portrait != null) {
BufferedImage portraitImg = ImageIO.read(portrait);
// 鏀剧缉澶у皬
- portraitImg = zoomInImage(portraitImg, 40,40);
+ portraitImg = zoomInImage(portraitImg, 40, 40);
// 鍦嗚
portraitImg = roundImage(portraitImg, 10);
-
+
g2d.drawImage(portraitImg, 70 + (qrcodeImage.getWidth() - portraitImg.getWidth()) / 2,
1092 + (qrcodeImage.getHeight() - portraitImg.getHeight()) / 2, null);
}
@@ -713,27 +713,25 @@
font = font.deriveFont(50.0f);
g2d.setFont(font);
g2d.setColor(new Color(229, 0, 93));
-// g2d.drawString("杩斿埄鍒告彁閱掓偍", 312, 1118 + 40);
+ // g2d.drawString("杩斿埄鍒告彁閱掓偍", 312, 1118 + 40);
g2d.setColor(new Color(102, 102, 102));
g2d.drawString("闀挎寜璇嗗埆浜岀淮鐮佸厤璐归鍒�", 312, 1150);
-
+
g2d.setColor(new Color(102, 102, 102));
g2d.drawString("鍏�", 1000, 1150);
-
-
+
g2d.setColor(new Color(229, 0, 93));
- g2d.drawString(goodsList.size()+"", 1055, 1150);
-
-
+ g2d.drawString(goodsList.size() + "", 1055, 1150);
+
g2d.setColor(new Color(102, 102, 102));
g2d.drawString("涓晢鍝�", 1090, 1150);
-
+
// 鎻愮ず璇�
BufferedImage tips = ImageIO
.read(ImageUtil.class.getClassLoader().getResourceAsStream("image/share/tips1.png"));
- tips = zoomInImage(tips,850, 65);
- g2d.drawImage(tips, 312,1190, null);
+ tips = zoomInImage(tips, 850, 65);
+ g2d.drawImage(tips, 312, 1190, null);
g2d.dispose();
@@ -751,7 +749,6 @@
return null;
}
-
// 鐢诲晢鍝佸垎浜浘
public static InputStream drawGoodsShareImgHCJ(InputStream qrcodeStream, InputStream portrait,
@@ -1074,7 +1071,7 @@
gs.dispose();
return image;
}
-
+
public static int saveToImgByInputStream(InputStream inputStream, String imgPath, String imgName) {
int stateInt = 1;
try {
--
Gitblit v1.8.0