| | |
| | | * @param goods |
| | | * @return |
| | | */ |
| | | public static InputStream drawGoodsPoster(InputStream qrcode, InputStream portraitStream, String inviteCode, GoodsDetailVO goods) { |
| | | public static InputStream drawGoodsPoster(InputStream qrcode, InputStream portraitStream, String inviteCode, |
| | | String mainPic, GoodsDetailVO goods) { |
| | | try { |
| | | String fontPath = "/usr/share/fonts/PingFang_Medium.ttf"; |
| | | String os = System.getProperty("os.name"); |
| | |
| | | int spacing = 20; // 右边距 |
| | | |
| | | // 1、画商品主图 |
| | | InputStream picStream = HttpUtil.getAsInputStream(goods.getPicUrl().replace("https://", "http://")); |
| | | InputStream picStream = HttpUtil.getAsInputStream(mainPic); |
| | | // InputStream picStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/test_pic1.jpg"); |
| | | g2d.drawImage(ImageIO.read(picStream), 0, 0, x, y, null); |
| | | |