<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          QRGenJava 二維碼封裝庫

          聯(lián)合創(chuàng)作 · 2023-09-30 12:57

          QRGen 是一個簡單的 Java 操作二維碼的開發(fā)庫,基于 ZXing 開發(fā),讓二維碼的操作更加簡單。支持 Android。

          示例代碼:

          // get QR file from text using defaults
          File file = QRCode.from("Hello World").file();
          
          // get QR stream from text using defaults
          ByteArrayOutputStream stream = QRCode.from("Hello World").stream();
          
          // override the image type to be JPG
          QRCode.from("Hello World").to(ImageType.JPG).file();
          QRCode.from("Hello World").to(ImageType.JPG).stream();
          
          // override image size to be 250x250
          QRCode.from("Hello World").withSize(250, 250).file();
          QRCode.from("Hello World").withSize(250, 250).stream();
          
          // override size and image type
          QRCode.from("Hello World").to(ImageType.GIF).withSize(250, 250).file();
          QRCode.from("Hello World").to(ImageType.GIF).withSize(250, 250).stream();
          
          // override default colors (black on white)
          // notice that the color format is "0x(alpha: 1 byte)(RGB: 3 bytes)"
          // so in the example below it's red for foreground and yellowish for background, both 100% alpha (FF).
          QRCode.from("Hello World").withColor(0xFFFF0000, 0xFFFFFFAA).file();
          
          // supply own outputstream
          QRCode.from("Hello World").to(ImageType.PNG).writeTo(outputStream);
          
          // supply own file name
          QRCode.from("Hello World").file("QRCode");
          
          // supply charset hint to ZXING
          QRCode.from("Hello World").withCharset("UTF-8");
          
          // supply error correction level hint to ZXING
          QRCode.from("Hello World").withErrorCorrection(ErrorCorrectionLevel.L);
          
          // supply any hint to ZXING
          QRCode.from("Hello World").withHint(EncodeHintType.CHARACTER_SET, "UTF-8");
          
          // encode contact data as vcard using defaults
          VCard johnDoe = new VCard("John Doe")
                              .setEmail("[email protected]")
                              .setAddress("John Doe Street 1, 5678 Doestown")
                              .setTitle("Mister")
                              .setCompany("John Doe Inc.")
                              .setPhoneNumber("1234")
                              .setWebsite("www.example.org");
          QRCode.from(johnDoe).file();
          
          // if using special characters don't forget to supply the encoding
          VCard johnSpecial = new VCard("J?hn D?e")
                                  .setAddress("????? Str??t 1, 1234 D?estüwn");
          QRCode.from(johnSpecial).withCharset("UTF-8").file();
          瀏覽 28
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  成人在线黄色视频网站 | 操逼黄片 | 伊人色香蕉 | aa片网站 | 色婷婷欧美亚洲激情综合另类在线 |