关于qrencode的使用
来源:互联网 发布:怎么做淘宝宝贝详情页 编辑:程序博客网 时间:2024/05/19 23:12
关于移植
conf.sh
#!/bin/sh
./configure \
--host=arm-sunnorth-linux-gnueabi \
--target=arm-sunnorth-linux-gnueabi \
--disable-shared --enable-static \
--prefix=$PWD/out/ --with-tools=no
其中--with-tools=no为不使用 libpng
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "qrencode.h"int CreatQRCodeByStr(char * str,int times){int ret = 0;int *bitmap = NULL;QRcode * qrcode = NULL;qrcode = QRcode_encodeString(str, 0, QR_ECLEVEL_M ,QR_MODE_8,1);if(qrcode == NULL){printf("call QRcode_encodeString error Ret = %d\n",ret);ret = 0;goto EXIT;}int tempiWidth = qrcode->width*times;int tempiHeight = qrcode->width*times;int sizebitmap = qrcode->width * qrcode->width * times * times *4;bitmap = malloc(sizebitmap);memset(bitmap,0,sizebitmap);int i,j;for(i=0;i<qrcode->width;i++){for(j=0;j<qrcode->width;j++){int colour = 0;if(qrcode->data[i*qrcode->width+j]&0x01){colour = 0xff000000;}else{colour = 0xffffffff;}int loopi = 0;for(loopi = 0;loopi < times;loopi++){int loopj = 0;for(loopj = 0;loopj < times;loopj++){bitmap[(i*times + loopi)*qrcode->width*times + j*times + loopj] = colour;}}}}for(i=0;i<qrcode->width*times;i++){for(j=0;j<qrcode->width*times;j++){if(bitmap[i*qrcode->width*times+j] == 0xffffffff){printf("#");}else{printf(" ");}}printf("\n");}printf("\n");EXIT:if(qrcode){QRcode_free(qrcode);qrcode = NULL;}if(bitmap){free(bitmap);bitmap = NULL;}return ret;}int main(){CreatQRCodeByStr("http://t.tt",3);}
0 0
- 关于qrencode的使用
- Windows 下使用 qrencode
- qrencode 库 的引入
- 使用qrencode库生成二维码
- QR code二维码简介及Qrencode库的移植与使用
- ucgui emwin使用qrencode显示二维码
- 基于qrencode-3.4.4的二维码生成
- qrencode-libqrecode的安装移植和应用-qrencode的交叉编译
- 在 WINDOWS 下使用 VS2010 编译QRENCODE为lib
- 二维码生成软件qrencode的安装与试用
- qrencode二维码生成在linux下的编译
- qrencode二维码生成在linux下的编译(转)
- qrencode 第三方库 的vs编译---------------------完全正确
- qrencode-3.4.4.tar.gz在arm上的移植
- C#下利用移植的qrencode生成二维码
- qrencode二维码生成库函数使用心得(一)(付测试源码)
- qrencode生成QRCode及使用ImageMagick和zbar从QRCode读取内容
- Qt:二维码的解析/扫描(QZxing)与生成(qrencode)
- RTC驱动程序分析
- 自动释放池的前世今生 ---- 深入解析 autoreleasepool
- qt超强精美绘图控件 - QCustomPlot一览 及 安装使用教程
- 科学论文2--Thoughts on high-performance computing的阅读与实践
- Codeforces Round #378 (Div. 2) C. Epidemic in Monstropolis(模拟)
- 关于qrencode的使用
- 认识下mysql中的存储过程使用以及语法
- 为您解惑:H5语义元素..........
- Markdown入门学习小结
- Js 实现字数限制,超出部分显示为省略号
- ELK 日志分析平台搭建
- 最大流 — Edmond Karp算法
- Unity有限状态机详解
- 我对Javascript数组的理解