Is it possible to generate a QR code with an icon?

Can you use lv_lib_qrcode to generate a personalized QR code, and embed the icon logo in the middle of the QR code? Does anyone have such ideas and needs?

It’s not supported by default.

However, there is a parameter called ECC level which tells how redundant the QR code is. In lv_qrcode.c it’s set to qrcodegen_Ecc_MEDIUM but you can set it to qrcodegen_Ecc_HIGH too.

This code

   lv_obj_t * qr = lv_qrcode_create(lv_scr_act(), 400, lv_color_black(), lv_color_white());
   const char * data = "https:lvgl.io";
   lv_qrcode_update(qr, data, strlen(data));

generated

image

And it still works:
image

1 Like

Thank you so much, this is what I want.