Giter Club home page Giter Club logo

awtk-qr's People

Contributors

cuitzhaoqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

awtk-qr's Issues

awtk-qr控件使用问题咨询

现在我遇到一个问题,创建二维码控件以后,再关闭应用时会出现内存错误。
mem.c如下函数出现异常。
static void tk_free_impl(void* ptr) {
s_mem_stat.used_block_nr--;
free(ptr);
}
测试代码如下:
widget_t *qr_code = qr_create(win, 100, 100, 200, 200);
qr_set_pixsize(qr_code, 5);
qr_set_text(qr_code, "123456789");
widget_set_self_layout_params(qr_code, "c", "50%", "50%", "50%");
widget_set_name(qr_code, "qr_code");
widget_use_style(qr_code, "qr_border");

问题咨询

问题1:创建一个二维码控件
void test(void)

assets_manager_t* rm = assets_manager();
assets_manager_load(rm, ASSET_TYPE_FONT, "default");
awtk_set_locale_simplified_chinese();
widget_t new_qr_code = qr_create(cont_obj, 20, 20, 80, 80);
qr_set_pixsize(new_qr_code, 3);
char tr_str[64];
int value = 123456;
const char format = locale_info_tr(locale_info(), "中文%d");
qr_set_text(new_qr_code, tr_str);
widget_set_name(new_qr_code, "new_qr_code");

问题:二维码是显示出来的但是我扫描后为什么中文是乱码,是哪地方没搞好吗?
打印出
for(i = 0; i < strlen(tr_str); i++)
{
rt_kprintf("%x ,", tr_str[i]);
}
输出:d6 ,d0 ,ce ,c4 ,31 ,32 ,33 ,34 ,35 ,36 扫码中文是乱码 123456正常 是什么问题?

问题2:我想获得二维码的点数据 我直接qr_t* qr = QR(new_qr_code); 的话得到的qr->qr_code_data是空,qr->qr_width 是 0所以我 如下操作 :
qr_t* qr = QR(new_qr_code);
if (qr->qr_text != NULL)
{
QRcode *qr_code;
qr_code = QRcode_encodeString((const char *)qr->qr_text, 3, QR_ECLEVEL_H,
QR_MODE_8, 1);
qr->qr_code_data = qr_code;
qr->qr_width = qr_code->width;
}
可以得到了宽度和数据。
那么1.能像上面那样操作来获得数据吗?
2.这个qr->qr_code_data 需要我手动QRcode_free吗?貌似我用时有时会导致我系统崩溃

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.