Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import com.google.zxing.BarcodeFormat;
  2. import com.google.zxing.EncodeHintType;
  3. import com.google.zxing.WriterException;
  4. import com.google.zxing.common.BitMatrix;
  5. import com.google.zxing.qrcode.QRCodeWriter;
  6. import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
  7.  
  8. import java.util.HashMap;
  9. import java.util.Map;
  10. //.......
  11. private BitMatrix createBitMatrix(String qrCodeText, int size) throws WriterException {
  12. Map<EncodeHintType, Object> hints = new HashMap<>();
  13. hints.put(EncodeHintType.MARGIN, DEFAULT_MARGIN);
  14. hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
  15. return new QRCodeWriter().encode(qrCodeText, BarcodeFormat.QR_CODE, size, size, hints);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement