Examples of Qrcode


Examples of com.google.zxing.qrcode.encoder.QRCode

        int barsize = -1;
        Writer writer = new MultiFormatWriter();
        try {
            Map<EncodeHintType, Object> hints = new EnumMap<EncodeHintType, Object>(EncodeHintType.class);
            hints.put(EncodeHintType.CHARACTER_SET, "ISO-8859-1");
            QRCode code = Encoder.encode(paymentString, ErrorCorrectionLevel.M, hints);
            hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
            barsize = size / (code.getMatrix().getWidth() + 8);
            matrix = writer.encode(paymentString, com.google.zxing.BarcodeFormat.QR_CODE, w, h, hints);
        } catch (com.google.zxing.WriterException e) {
            System.out.println(e.getMessage());
        }
View Full Code Here

Examples of com.swetake.util.Qrcode

  }
  private BufferedImage qRCodeCommon(String content, String imgType, int size) { 
            BufferedImage bufImg = null
            try
                Qrcode qrcodeHandler = new Qrcode()
               // ���ö�ά���Ŵ��ʣ���ѡL(7%)��M(15%)��Q(25%)��H(30%)���Ŵ���Խ�߿ɴ洢����ϢԽ�٣����Զ�ά�������ȵ�Ҫ��ԽС 
                qrcodeHandler.setQrcodeErrorCorrect('M')
                qrcodeHandler.setQrcodeEncodeMode('B')
                // �������ö�ά��ߴ磬ȡֵ��Χ1-40��ֵԽ��ߴ�Խ�󣬿ɴ洢����ϢԽ�� 
                qrcodeHandler.setQrcodeVersion(size)
               // ������ݵ��ֽ����飬���ñ����ʽ 
               byte[] contentBytes = content.getBytes("utf-8")
                // ͼƬ�ߴ� 
               int imgSize = 67 + 12 * (size - 1)
                bufImg = new BufferedImage(imgSize, imgSize, BufferedImage.TYPE_INT_RGB)
                Graphics2D gs = bufImg.createGraphics()
                // ���ñ�����ɫ 
               gs.setBackground(Color.WHITE)
               gs.clearRect(0, 0, imgSize, imgSize)
   
               // �趨ͼ����ɫ> BLACK 
               gs.setColor(Color.BLACK)
                // ����ƫ�����������ÿ��ܵ��½������� 
               int pixoff = 2
                // �������> ��ά�� 
               if (contentBytes.length > 0 && contentBytes.length < 800) { 
                  boolean[][] codeOut = qrcodeHandler.calQrcode(contentBytes)
                    for (int i = 0; i < codeOut.length; i++) { 
                      for (int j = 0; j < codeOut.length; j++) { 
                           if (codeOut[j][i]) { 
                           gs.fillRect(j * 3 + pixoff, i * 3 + pixoff, 3, 3)
                           
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.QRCode

    public void test1() {

  QRCodeDataInterface data;
  data = new QRCodeAutomaticData(QRCodeErrorCorrectionLevel.standard, QRCodeMaskNumber.none, "QR Code");

  QRCode command = new QRCode(Orientation.horizontal, new Position(10, 100), QRCodeModelType.model2, 10, data);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE QR 10 100 M 2 U 10");
  output.printLn("MA,QR Code");
  output.printLn("ENDQR");
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.QRCode

  QRCodeManualData data;
  data = new QRCodeManualData(QRCodeErrorCorrectionLevel.ultraHighReliability, QRCodeMaskNumber.mask0);
  data.addData(new QRCodeManualDataItem(QRCodeCharacterMode.numeric, "0123456789012345"));

  QRCode command = new QRCode(Orientation.horizontal, new Position(10, 100), QRCodeModelType.model2, 10, data);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE QR 10 100 M 2 U 10");
  output.printLn("H0M,N0123456789012345");
  output.printLn("ENDQR");
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.QRCode

  QRCodeManualData data;
  data = new QRCodeManualData(QRCodeErrorCorrectionLevel.ultraHighReliability, QRCodeMaskNumber.mask0);
  data.addData(new QRCodeManualDataItem(QRCodeCharacterMode.alphanumeric, "AC-42"));

  QRCode command = new QRCode(Orientation.horizontal, new Position(10, 100), QRCodeModelType.model2, 10, data);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE QR 10 100 M 2 U 10");
  output.printLn("H0M,AAC-42");
  output.printLn("ENDQR");
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.QRCode

  data.addData(new QRCodeManualDataItem(QRCodeCharacterMode.alphanumeric, "QR code"));
  data.addData(new QRCodeManualDataItem(QRCodeCharacterMode.numeric, "0123456789012345"));
  data.addData(new QRCodeManualDataItem(QRCodeCharacterMode.alphanumeric, "QRCODE"));
  data.addData(new QRCodeManualDataItem(QRCodeCharacterMode.binary, "qrcode"));

  QRCode command = new QRCode(Orientation.horizontal, new Position(10, 100), QRCodeModelType.model2, 10, data);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE QR 10 100 M 2 U 10");
  output.printLn("LM,AQR code,N0123456789012345,AQRCODE,B0006qrcode");
  output.printLn("ENDQR");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.