
setColor() sets this graphics context's current color to the specified color. Graphics2D crunchifyGraphics = (Graphics2D) crunchifyImage.getGraphics() This is the fundamental class for rendering 2-dimensional shapes, text and images on the Java(tm) platform. This Graphics2D class extends the Graphics class to provide more sophisticated control over geometry, coordinate transformations, color management, and text layout. Creates a Graphics2D, which can be used to draw into this BufferedImage. The BufferedImage subclass describes an Image with an accessible buffer of crunchifyImage data.īufferedImage crunchifyImage = new BufferedImage(CrunchifyWidth, CrunchifyWidth, Int CrunchifyWidth = crunchifyBitMatrix.getWidth() QRCodeWriter mYQRCodeWriter = new QRCodeWriter() // throws īitMatrix crunchifyBitMatrix = mYQRCodeWriter.encode(m圜odeText, BarcodeFormat.QR_CODE, size, Object put = crunchifyHintType.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H) Now with version 3.4.1 you could change margin (white border size)ĬrunchifyHintType.put(EncodeHintType.MARGIN, 1) /* default = 4 */ Map crunchifyHintType = new EnumMap(EncodeHintType.class) ĬrunchifyHintType.put(EncodeHintType.CHARACTER_SET, "UTF-8") String filePath = "/Users/app/Document/" * Simple QR Code Generator Example - Create QR codes for free. Here is a simple Java Code which generates QR code for you.


However the project can be used to encode and decode barcodes on desktops and servers as well. Our focus is on using the built-in camera on mobile phones to scan and decode barcodes on the device, without communicating with a server.
