Commit 64123a2d by 王祖波

改为jpg

parent d7747abd
...@@ -116,7 +116,7 @@ public class DrawImageUtils { ...@@ -116,7 +116,7 @@ public class DrawImageUtils {
int amountX = drawBkgImg.amountStart + (drawBkgImg.amountWidth - metrics.stringWidth(amountText)) / 2; int amountX = drawBkgImg.amountStart + (drawBkgImg.amountWidth - metrics.stringWidth(amountText)) / 2;
pen.drawString(amountText, amountX, 250); pen.drawString(amountText, amountX, 250);
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(image, "jpg", bos); ImageIO.write(image, "png", bos);
pen.dispose(); pen.dispose();
CloudFileInfo cloudFileInfo = CloudFileUtil.uploadFile(bos.toByteArray(), "jpg", CloudFileTypeEnum.IMAGE, factoryCode, CloudFileBusinessOptEnum.HAOBAN_COMMON); CloudFileInfo cloudFileInfo = CloudFileUtil.uploadFile(bos.toByteArray(), "jpg", CloudFileTypeEnum.IMAGE, factoryCode, CloudFileBusinessOptEnum.HAOBAN_COMMON);
log.info("上传图片结果:{}", JSON.toJSONString(cloudFileInfo)); log.info("上传图片结果:{}", JSON.toJSONString(cloudFileInfo));
...@@ -136,8 +136,8 @@ public class DrawImageUtils { ...@@ -136,8 +136,8 @@ public class DrawImageUtils {
Random random = new Random(); Random random = new Random();
String url = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "", String url = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "",
Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.AREA_MONTH_BKG); Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.AREA_MONTH_BKG);
System.out.println(url);
String temp = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "", // String temp = DrawImageUtils.drawImage("jhdm", Math.abs(random.nextInt(1000)) + "",
Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.CLERK_MONTH_BKG); // Math.abs(random.nextInt(1000)) + "万", DrawBkgImg.CLERK_MONTH_BKG);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment