生成彩色二维码 [英] Generate colorful QR code

查看:41
本文介绍了生成彩色二维码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成彩色二维码.我曾使用 https://github.com/kuapay/iOS-QR-Code-Generator 代码生成二维码.现在生成的二维码总是黑色.我想用红色或任何其他颜色.着色的编码和QR码.png图像的绘制是在QR_Draw_png.mm文件中完成的.我应该在 QR_Draw_png.mm 这个文件.如何生成彩色二维码.

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 black color.I want to make it in Red or any other color. The coding of coloring And the drawing of QR code .png image is done QR_Draw_png.mm file. What should i edit in QR_Draw_png.mm this file. How to do the generate the colorful qr code.

这怎么可能.

请帮帮我.

推荐答案

这是生成彩色二维码的最佳示例.

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/

你会从上面的链接中找到 qrencode 库,以及 UIImage 的类别.

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];

这篇关于生成彩色二维码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆