Package app.YUP.utils

Class QRCodeService

java.lang.Object
app.YUP.utils.QRCodeService

public class QRCodeService extends Object
A utility class for generating QR codes.
  • Method Details

    • generateQrcode

      public static BufferedImage generateQrcode(String barcodeText)
      Generates a QR code image from the provided text.
      Parameters:
      barcodeText - the text to be encoded in the QR code
      Returns:
      a BufferedImage representing the generated QR code
    • toImage

      public static BufferedImage toImage(io.nayuki.qrcodegen.QrCode qr, int scale, int border, int lightColor, int darkColor)
      Converts a QrCode object to a BufferedImage.
      Parameters:
      qr - the QrCode object to be converted
      scale - the scale factor for the QR code image
      border - the border size for the QR code image
      lightColor - the color to be used for the light modules of the QR code
      darkColor - the color to be used for the dark modules of the QR code
      Returns:
      a BufferedImage representing the QR code
      Throws:
      IllegalArgumentException - if scale is less than or equal to 0, or if border is less than 0, or if the calculated size exceeds Integer.MAX_VALUE