Class QRCode


  • public class QRCode
    extends Object
    This Class represent the Logical model of the QR code and rendering of the QR Code image.
    • Constructor Detail

      • QRCode

        public QRCode​(String data,
                      int version,
                      int size,
                      int errorLevel,
                      StyleConfig style)
               throws QREncoderException
        Parameters:
        data - Text Data which need to be encoded in QR Code.
        version - Version of the QR Code to be used.
        size - Size of the QR Code.
        errorLevel - level of Error Correction in QR Code.
        style - StyleConfig to define the Visual appearance of the QR Code.
        Throws:
        QREncoderException - in case of mistatch of given argument data.
    • Method Detail

      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        String representation of QRCode properties.
      • setStyle

        public void setStyle​(StyleConfig style)
        Parameters:
        style - StyleConfig object to which will be replaced with current style.
      • getStyleConfig

        public StyleConfig getStyleConfig()
        Returns:
        StyleConfig property of the QRCode object.
      • of

        public static Graphics2D of​(BufferedImage source)
        Render the QRCode to the Image and return it as a BufferedImage.
        Parameters:
        source - Input Buffered Image
        Returns:
        BufferedImage of the QRCode. The image will contain only QRCode, without any logo image or margins.