生成二维码 - CreateQRCode
函数简介
根据字符串数据生成二维码图片。
接口名称
CreateQRCode
DLL调用
long CreateQRCode(long ola, string str, int pixelsPerModule);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| str | 字符串 | 生成二维码的字符串数据 |
| pixelsPerModule | 整数型 | 每个数据像素大小 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 生成二维码,每个模块10像素
long img = CreateQRCode(instance, "https://example.com", 10);
if (img != 0) {
// 使用二维码图片...
FreeImagePtr(instance, img);
}
Python
# 待补充
返回值
长整数型:返回OLAImage对象的地址,失败返回0。
注意事项
- 返回的图片需调用 FreeImagePtr 释放内存。
