| | |
| | | InputStream portraitInputStream = HttpUtil.getAsInputStream(portrait); // 头像 |
| | | InputStream erCodeInputStream = new FileInputStream(new File(erCodeTempPath)); // 二维码 |
| | | |
| | | // 官方默认头像 |
| | | if (portraitInputStream == null) { |
| | | portraitInputStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/official_icon.png"); |
| | | } |
| | | |
| | | |
| | | // 开始根据 url(背景图), qrCode(二维码), portrait(头像) 生成图片 |
| | | ImageUtil.inviteFriendImg(urlInputStream, portraitInputStream, erCodeInputStream, targetPath, inviteCode); |
| | | |
| | |
| | | InputStream portraitInputStream = HttpUtil.getAsInputStream(portrait); // 头像 |
| | | InputStream erCodeInputStream = new FileInputStream(new File(erCodeTempPath)); // 二维码 |
| | | |
| | | // 官方默认头像 |
| | | if (portraitInputStream == null) { |
| | | portraitInputStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/official_icon.png"); |
| | | } |
| | | |
| | | // 开始根据 url(背景图), qrCode(二维码), portrait(头像) 生成图片 |
| | | ImageUtil.inviteFriendImg(urlInputStream, portraitInputStream, erCodeInputStream, targetPath, |
| | | erCodePostionX, erCodePostionY, erCodeSize, inviteCode); |
| | |
| | | portraitInputStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/official_icon.png"); |
| | | |
| | | } else { |
| | | |
| | | targetPath = FileUtil.getCacheDir() + "/share_" + uid + "_" + System.currentTimeMillis() + ".jpg"; |
| | | erCodeTempPath = FileUtil.getCacheDir() + "/" + uid + "_" + System.currentTimeMillis() + ".jpg"; |
| | | |
| | |
| | | portraitInputStream = HttpUtil.getAsInputStream(portrait); // 头像 |
| | | erCodeInputStream = new FileInputStream(new File(erCodeTempPath)); // 二维码 |
| | | } |
| | | |
| | | |
| | | // 官方默认头像 |
| | | if (portraitInputStream == null) { |
| | | portraitInputStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/official_icon.png"); |
| | | } |
| | | |
| | | |
| | | // 开始根据 url(背景图), qrCode(二维码), portrait(头像) 生成图片 |
| | | ImageUtil.inviteFriendImgWhitecustom(urlInputStream, portraitInputStream, erCodeInputStream, targetPath, pX, pY, |
| | | size, inviteCode); |
| | |
| | | portraitInputStream = HttpUtil.getAsInputStream(portrait); // 头像 |
| | | } |
| | | |
| | | // 官方默认头像 |
| | | if (portraitInputStream == null) { |
| | | portraitInputStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/official_icon.png"); |
| | | } |
| | | |
| | | // 开始根据 url(背景图), qrCode(二维码), portrait(头像) 生成图片 |
| | | ImageUtil.drawInviteToGreet(urlInputStream, portraitInputStream, erCodeInputStream, targetPath, inviteCode, |
| | | content, date); |
| | |
| | | |
| | | |
| | | @Override |
| | | public FileUploadResult drawDynamicGoodsPoster(String erCodeUrl, String portrait, String inviteCode, GoodsDetailVO goods) { |
| | | public FileUploadResult drawDynamicGoodsPoster(String erCodeUrl, String portrait, String inviteCode, |
| | | String mainPic, GoodsDetailVO goods) { |
| | | // 二维码流 |
| | | InputStream erCodeStream = null; |
| | | try { |
| | | erCodeStream = QRCodeUtil.getInstance(250).encode(erCodeUrl); |
| | | erCodeStream = QRCodeUtil.getInstance(250).encodeDeleteWhite(erCodeUrl); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | |
| | | } |
| | | |
| | | // 画图 |
| | | InputStream drawStream = ImageUtil.drawGoodsPoster(erCodeStream, portraitStream,inviteCode, goods); |
| | | InputStream drawStream = ImageUtil.drawGoodsPoster(erCodeStream, portraitStream,inviteCode,mainPic, goods); |
| | | // 上传位置 |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | String upPath = FilePathEnum.shareGoods.getPath() + uuid + "_" + goods.getGoodsId() + "_" + System.currentTimeMillis() + ".png"; |