| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 901 人关注过本帖, 1 人收藏
标题:字串转二维码,简单易用,无乱码
取消只看楼主 加入收藏
sych
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:7
帖 子:333
专家分:538
注 册:2019-10-11
结帖率:100%
收藏(1)
已结贴  问题点数:20 回复次数:1 
字串转二维码,简单易用,无乱码
DECLARE FullQRCode IN "QRCodeLib.dll" ;
    INTEGER lAutoConfigurate, ;
    INTEGER lAutoFit, ;
    LONG nBackColor, ;
    LONG nBarColor, ;
    STRING cText, ;
    INTEGER nCorrectionLevel, ;
    INTEGER nEncoding, ;
    INTEGER nMarginPixels, ;
    INTEGER nModuleWidth, ;
    INTEGER nHeight, ;
    INTEGER nWidth, ;
    STRING cFileName

m.lAutoConfigurate = .T.
m.lAutoFit = .T.
m.nBackColor = RGB(255, 255, 255) && White
m.nBarColor = RGB(0, 0, 0) && Black
m.nCorrectionLevel = 1 && 0-[L]ow 7%, 1-[M]edium 15%, 2-[Q]uartile 25%, 3-[H]igh 30%]
m.nEncoding = 4 && Automatic encoding algorithm
m.nMarginPixels = 0 && pixels
m.nModuleWidth = 2 && pixels
m.nHeight = 132 && pixels
m.nWidth = 132 && pixels
m.tcText="123中国123中国123中国123中国123中国123中国123中国"
m.tcFile="1.bmp"

FullQRCode(m.lAutoConfigurate, m.lAutoFit, m.nBackColor, m.nBarColor, ;
    m.tcText, m.nCorrectionLevel, m.nEncoding, m.nMarginPixels, ;
    m.nModuleWidth, m.nHeight, m.nWidth, m.tcFile)

QRCodeLib.dll文件是https://里面的文件
qrcodelib.rar (172.79 KB)
收到的鲜花
  • 厨师王德榜2023-06-19 13:35 送鲜花  1朵   附言:感谢分享
搜索更多相关主题的帖子: 乱码 二维 中国 文件 INTEGER 
2023-06-17 20:10
sych
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:7
帖 子:333
专家分:538
注 册:2019-10-11
收藏
得分:0 
上面的代码没有经过充分测试,还是有BUG,在最后添加一句为好
m.tcText=iif(left(m.tcText,3)==0hEFBBBF,m.tcText,0hEFBBBF+STRCONV(m.tcText,9))
完整代码如下:
DECLARE FullQRCode IN "QRCodeLib.dll" ;
    INTEGER lAutoConfigurate, ;
    INTEGER lAutoFit, ;
    LONG nBackColor, ;
    LONG nBarColor, ;
    STRING cText, ;
    INTEGER nCorrectionLevel, ;
    INTEGER nEncoding, ;
    INTEGER nMarginPixels, ;
    INTEGER nModuleWidth, ;
    INTEGER nHeight, ;
    INTEGER nWidth, ;
    STRING cFileName

m.lAutoConfigurate = .t.
m.lAutoFit = .t.
m.nBackColor = RGB(255,255,255) && White
m.nBarColor = RGB(0, 0, 0) && Black
m.nCorrectionLevel = 1 && 0-[L]ow 7%, 1-[M]edium 15%, 2-[Q]uartile 25%, 3-[H]igh 30%]
m.nEncoding = 4 && Automatic encoding algorithm
m.nMarginPixels = 0 && pixels
m.nModuleWidth = 2 && pixels
m.nWidth = 500 && pixels
m.nHeight = m.nWidth && pixels
m.tcText=repl("中",5)
m.tcFile="1.bmp"
m.tcText=iif(left(m.tcText,3)==0hEFBBBF,m.tcText,0hEFBBBF+STRCONV(m.tcText,9))

FullQRCode(m.lAutoConfigurate, m.lAutoFit, m.nBackColor, m.nBarColor, ;
    m.tcText, m.nCorrectionLevel, m.nEncoding, m.nMarginPixels, ;
    m.nModuleWidth, m.nHeight, m.nWidth, m.tcFile)

还有这三个参数不知道什么意思,有知道的朋友请不吝赐教
m.lAutoConfigurate = .t.
m.lAutoFit = .t.
m.nEncoding = 4 && Automatic encoding algorithm
2023-06-18 20:27
快速回复:字串转二维码,简单易用,无乱码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.071985 second(s), 11 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved