|
@@ -49,7 +49,7 @@ public class ParticipantServiceTest extends ApplicationTests {
|
|
|
Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
|
|
Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
|
|
|
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
|
|
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
|
|
|
hints.put(EncodeHintType.MARGIN, 1);
|
|
hints.put(EncodeHintType.MARGIN, 1);
|
|
|
- BitMatrix bitMatrix = new MultiFormatWriter().encode("http://yskj.njlyw.cn:8081/h5?progremmeId=17824", BarcodeFormat.QR_CODE, 1000, 1000, hints);
|
|
|
|
|
|
|
+ BitMatrix bitMatrix = new MultiFormatWriter().encode("http://yskj.njlyw.cn:8081/h5/home?performanceId=17824", BarcodeFormat.QR_CODE, 1000, 1000, hints);
|
|
|
// BufferedImage image = new BufferedImage(240, 240, BufferedImage.TYPE_INT_RGB);
|
|
// BufferedImage image = new BufferedImage(240, 240, BufferedImage.TYPE_INT_RGB);
|
|
|
BufferedImage code = MatrixToImageWriter.toBufferedImage(bitMatrix);
|
|
BufferedImage code = MatrixToImageWriter.toBufferedImage(bitMatrix);
|
|
|
// BufferedImage avatar = ImageIO.read(new File("/Users/qiufangchao/Desktop/17824.png"));
|
|
// BufferedImage avatar = ImageIO.read(new File("/Users/qiufangchao/Desktop/17824.png"));
|
|
@@ -58,7 +58,7 @@ public class ParticipantServiceTest extends ApplicationTests {
|
|
|
// BufferedImage subImg = avatar
|
|
// BufferedImage subImg = avatar
|
|
|
// .getSubimage((avatar.getWidth() - size) / 2, (avatar.getHeight() - size) / 2, size, size);
|
|
// .getSubimage((avatar.getWidth() - size) / 2, (avatar.getHeight() - size) / 2, size, size);
|
|
|
|
|
|
|
|
- BufferedImage avatarImg = new BufferedImage(120 * 2, 120 * 2, BufferedImage.TYPE_INT_ARGB);
|
|
|
|
|
|
|
+ BufferedImage avatarImg = new BufferedImage(249, 249, BufferedImage.TYPE_INT_ARGB);
|
|
|
Graphics2D g2 = avatarImg.createGraphics();
|
|
Graphics2D g2 = avatarImg.createGraphics();
|
|
|
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
|
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
|
|
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
|
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
|
@@ -67,8 +67,8 @@ public class ParticipantServiceTest extends ApplicationTests {
|
|
|
g2.setBackground(Color.GREEN);
|
|
g2.setBackground(Color.GREEN);
|
|
|
// g2.setClip(new Ellipse2D.Float(0, 0, 68 * 2, 76 * 2)); //椭圆
|
|
// g2.setClip(new Ellipse2D.Float(0, 0, 68 * 2, 76 * 2)); //椭圆
|
|
|
|
|
|
|
|
- g2.drawImage(code, 0, 0, 120 * 2, 120 * 2, null);
|
|
|
|
|
- g.drawImage(avatarImg, 1898, 253, 120 * 2, 120 * 2, null);
|
|
|
|
|
|
|
+ g2.drawImage(code, 0, 0, 249, 249, null);
|
|
|
|
|
+ g.drawImage(avatarImg, 1894, 248, 249, 249, null);
|
|
|
|
|
|
|
|
|
|
|
|
|
// 文字
|
|
// 文字
|