您的位置:首页 > 编程语言 > C语言/C++

c++生成二维码

2015-11-29 21:23 375 查看
vs2010编译好的qrencode库:http://files.cnblogs.com/files/verstin/qrencode.rar

版本是3.4.4

编译方法参考:/article/1486885.html

测试代码:

#include <iostream>
#include "qrencode.h"
using namespace std;
int main(int argc, char *argv[])
{
QRcode *qr=QRcode_encodeString("http://www.cnblogs.com/verstin/",1,QR_ECLEVEL_L,  QR_MODE_8,1);

int width=qr->width;
int height=width;
for (int y=0;y<height;y++)
{
for (int x=0;x<width;x++)
{
if(qr->data[y*width+x]&0x01)
cout<<"##";
else
cout<<"  ";

}
cout<<endl;
}
QRcode_free(qr);

cin.get();
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: