var qrcode = new QRCode("qrcode"); var qrcode = new QRCode("test", { text: "http://jindo.dev.naver.com/collie", width: 400, height: 400, colorDark : "#000000", colorLight : "#ffffff", correctLevel : QRCode.CorrectLevel.H });
public BitMatrix encode(String contents, BarcodeFormat format, int multiple, Hashtable hints) throws WriterException { if (contents == null || contents.length() == 0) { throw new IllegalArgumentException("Found empty contents"); } if (format != BarcodeFormat.QR_CODE) { throw new IllegalArgumentException("Can only encode QR_CODE, but got " + format); } ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.L; if (hints != null) { ErrorCorrectionLevel requestedECLevel = (ErrorCorrectionLevel) hints.get(EncodeHintType.ERROR_CORRECTION); if (requestedECLevel != null) { errorCorrectionLevel = requestedECLevel; } } QRCode code = new QRCode(); Encoder.encode(contents, errorCorrectionLevel, hints, code); return renderResult(code, multiple); }
public BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Hashtable hints) throws WriterException { if (contents == null || contents.length() == 0) { throw new IllegalArgumentException("Found empty contents"); } if (format != BarcodeFormat.QR_CODE) { throw new IllegalArgumentException("Can only encode QR_CODE, but got " + format); } if (width < 0 || height < 0) { throw new IllegalArgumentException("Requested dimensions are too small: " + width + 'x' + height); } ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.L; if (hints != null) { ErrorCorrectionLevel requestedECLevel = (ErrorCorrectionLevel) hints.get(EncodeHintType.ERROR_CORRECTION); if (requestedECLevel != null) { errorCorrectionLevel = requestedECLevel; } } QRCode code = new QRCode(); Encoder.encode(contents, errorCorrectionLevel, hints, code); return renderResult(code, width, height); }
public class QRCodeScreen extends MainScreen { private String qrCode; private static final int QRCODE_WIDTH = 100; private BitmapField qrImage; public QRCodeScreen(String qrCode) { this.qrCode = "Test String"; qrImage = new BitmapField(new Bitmap(QRCODE_WIDTH, QRCODE_WIDTH),FIELD_HCENTER); qrImage.setBorder(BorderFactory.createBevelBorder(new XYEdges(2, 2, 2, 2))); try { QRCode code = new QRCode(); Encoder.encode(qrCode, ErrorCorrectionLevel.L, code); ByteMatrix barcode = code.getMatrix(); Bitmap bitmap = BarcodeBitmap.createBitmap(barcode, QRCODE_WIDTH); qrImage.setBitmap(bitmap); } catch (Exception e) { e.printStackTrace(); } add(qrImage); } }
try { QRCode code = new QRCode(); matrix = encode(contents, code);
ecBlocks.getNumBlocks()); QRCode qrCode = new QRCode();
ecBlocks.getNumBlocks()); QRCode qrCode = new QRCode();