Class SQRCode


  • public class SQRCode
    extends java.lang.Object
    Author:
    sokkheang.huo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String None  
      static java.lang.String WEP  
      static java.lang.String WPA_WPA2_WPA3  
    • Constructor Summary

      Constructors 
      Constructor Description
      SQRCode()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean GenerateQRCode​(java.lang.String url, java.lang.String qrcode_output, int width, int height)  
      static boolean GenerateQRCodeURL​(java.lang.String url, java.lang.String qrcode_output, int width, int height)  
      static void generateQRCodeWifi_None​(java.lang.String wifiName, int width, int height, java.lang.String qrcode_output)  
      static void generateQRCodeWifi_WEP​(java.lang.String wifiName, java.lang.String password, int width, int height, java.lang.String qrcode_output)  
      static void generateQRCodeWifi_WPA_WPA2_WPA3​(java.lang.String wifiName, java.lang.String password, int width, int height, java.lang.String qrcode_output)  
      static boolean GenerateQRCodeWithBG​(java.lang.String DataBarCode, int width, int height, java.lang.String path_logo, java.lang.String output_logo, java.awt.Color qr_code_color)  
      static void GenerateQRCodeWithLogo​(java.lang.String dataQRCode, java.lang.String logo_path, java.lang.String qrcode_output, java.lang.String fileFormat, int width, int height)  
      static java.lang.String readQRcode​(java.lang.String qrcode_path)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SQRCode

        public SQRCode()
    • Method Detail

      • GenerateQRCodeWithBG

        public static boolean GenerateQRCodeWithBG​(java.lang.String DataBarCode,
                                                   int width,
                                                   int height,
                                                   java.lang.String path_logo,
                                                   java.lang.String output_logo,
                                                   java.awt.Color qr_code_color)
                                            throws java.lang.Exception
        Parameters:
        DataBarCode -
        width -
        height -
        path_logo -
        output_logo -
        qr_code_color -
        Returns:
        Throws:
        java.lang.Exception -
         public static void main(String[] args) throws Exception {                                                                                                                   
                        SQRCode.GenerateQRCode("https://brojum.com", 900, 900, System.getProperty("user.dir") +"/"+ "image.png", System.getProperty("user.dir") +"/"+ "qrcode.png", Color.BLUE);
         }                                                                                                                                                                           
         
      • GenerateQRCode

        public static boolean GenerateQRCode​(java.lang.String url,
                                             java.lang.String qrcode_output,
                                             int width,
                                             int height)
                                      throws com.google.zxing.WriterException,
                                             java.io.IOException
        Parameters:
        url -
        qrcode_output -
        Throws:
        com.google.zxing.WriterException
        java.io.IOException -
         public static void main(String[] args) throws WriterException, IOException {            
                        GenerateQRCode("https://brojum.com", System.getProperty("user.dir")+"/"+"qrcode.png");
         }                                                                                       
         
      • GenerateQRCodeURL

        public static boolean GenerateQRCodeURL​(java.lang.String url,
                                                java.lang.String qrcode_output,
                                                int width,
                                                int height)
                                         throws com.google.zxing.WriterException,
                                                java.io.IOException
        Parameters:
        url -
        qrcode_output -
        Throws:
        com.google.zxing.WriterException
        java.io.IOException -
         public static void main(String[] args) throws WriterException, IOException {            
                        GenerateQRCodeURL("https://brojum.com", System.getProperty("user.dir")+"/"+"qrcode.png");
         }                                                                                       
         
      • readQRcode

        public static java.lang.String readQRcode​(java.lang.String qrcode_path)
                                           throws com.google.zxing.WriterException,
                                                  java.io.IOException,
                                                  com.google.zxing.NotFoundException
        Parameters:
        qrcode_path -
        Returns:
        Throws:
        com.google.zxing.WriterException
        java.io.IOException
        com.google.zxing.NotFoundException -
         public static void main(String[] args) throws WriterException, IOException {            
                        readQRcode(System.getProperty("user.dir") + "/" + "qrcode.png");
         }                                                                                       
         
      • GenerateQRCodeWithLogo

        public static void GenerateQRCodeWithLogo​(java.lang.String dataQRCode,
                                                  java.lang.String logo_path,
                                                  java.lang.String qrcode_output,
                                                  java.lang.String fileFormat,
                                                  int width,
                                                  int height)
                                           throws java.lang.Exception
        Parameters:
        dataQRCode -
        logo_path -
        qrcode_output -
        fileFormat -
        width -
        height -
        Throws:
        java.lang.Exception -
         public static void main(String[] args) throws Exception {
                        GenerateQRCodeWithLogo("https://brojum.com", System.getProperty("user.dir") + "/logo.png", System.getProperty("user.dir") + "/qrcode.png", "png", 1000, 1000);
         }
         
      • generateQRCodeWifi_WPA_WPA2_WPA3

        public static void generateQRCodeWifi_WPA_WPA2_WPA3​(java.lang.String wifiName,
                                                            java.lang.String password,
                                                            int width,
                                                            int height,
                                                            java.lang.String qrcode_output)
                                                     throws com.google.zxing.WriterException,
                                                            java.io.IOException,
                                                            com.google.zxing.NotFoundException
        Parameters:
        wifiName -
        password -
        width -
        height -
        qrcode_output -
        Throws:
        com.google.zxing.WriterException
        java.io.IOException
        com.google.zxing.NotFoundException -
         public static void main(String[] args) throws NotFoundException, WriterException, IOException {
                generateQRCodeWifi_WPA_WPA2_WPA3("Partner", "W!ngpartner@2022", 1000, 1000, System.getProperty("user.dir") + "/" + "wifi_qr.png");
         }
         
      • generateQRCodeWifi_WEP

        public static void generateQRCodeWifi_WEP​(java.lang.String wifiName,
                                                  java.lang.String password,
                                                  int width,
                                                  int height,
                                                  java.lang.String qrcode_output)
                                           throws com.google.zxing.WriterException,
                                                  java.io.IOException,
                                                  com.google.zxing.NotFoundException
        Parameters:
        wifiName -
        password -
        width -
        height -
        qrcode_output -
        Throws:
        com.google.zxing.WriterException
        java.io.IOException
        com.google.zxing.NotFoundException -
         public static void main(String[] args) throws NotFoundException, WriterException, IOException {
                generateQRCodeWifi_WEP("Partner", "W!ngpartner@2022", 1000, 1000, System.getProperty("user.dir") + "/" + "wifi_qr.png");
         }
         
      • generateQRCodeWifi_None

        public static void generateQRCodeWifi_None​(java.lang.String wifiName,
                                                   int width,
                                                   int height,
                                                   java.lang.String qrcode_output)
                                            throws com.google.zxing.WriterException,
                                                   java.io.IOException,
                                                   com.google.zxing.NotFoundException
        Parameters:
        wifiName -
        width -
        height -
        qrcode_output -
        Throws:
        com.google.zxing.WriterException
        java.io.IOException
        com.google.zxing.NotFoundException -
         public static void main(String[] args) throws NotFoundException, WriterException, IOException {
                generateQRCodeWifi_None("Partner", 1000, 1000, System.getProperty("user.dir") + "/" + "wifi_qr.png");
         }