Generate colorful QR code

后端 未结 4 742
萌比男神i
萌比男神i 2020-12-04 00:31

I want to generate the colorful QR code. I had used https://github.com/kuapay/iOS-QR-Code-Generator code to generate the QR code. now the qr code generated is always n blac

相关标签:
4条回答
  • 2020-12-04 01:05

    https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=https://stackoverflow.com/questions/8063575/generate-colorful-qr-code%2F&choe=UTF-8

    Use this link same generate web,android,iPhone.

    0 讨论(0)
  • 2020-12-04 01:06

    This is the best example to generate colorful QR code.

    http://www.oscarsanderson.com/2013/08/12/implementing-a-qr-code-generator-on-the-iphone/

    You will found qrencode library from above link, and Category of UIImage.

    After you need to simple call this method with your selected Color to generate it.

    mgView.image = [UIImage QRCodeGenerator:txtCouponName.text
                              andLightColour:[UIColor whiteColor]
                               andDarkColour:[UIColor blackColor]
                                andQuietZone:1
                                     andSize:300];
    
    0 讨论(0)
  • 2020-12-04 01:17
         QRCodeWriter writer = new QRCodeWriter();
        try {
            BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, 512, 512);
            int width = bitMatrix.getWidth();
            int height = bitMatrix.getHeight();
            Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
            for (int x = 0; x < width; x++) {
                for (int y = 0; y < height; y++) {
    // set colors for QR code
                    bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
                }
            }
            ((ImageView) findViewById(R.id.img_result_qr)).setImageBitmap(bmp);
    
        } catch (WriterException e) {
            e.printStackTrace();
        }
    
    0 讨论(0)
  • 2020-12-04 01:18

    You'll have to tinker with the Z-Bar code to do that.

    Maybe these links might help:

    http://mashable.com/2011/04/18/qr-code-design-tips/

    http://qreateandtrack.com/2011/01/06/adding-a-bit-of-color-to-your-qr-codes/

    and

    http://keremerkan.net/qr-code-and-2d-code-generator/

    0 讨论(0)
提交回复
热议问题