The version I am currently using is lvgl8.3.
I referred to 'https://lvgl.100ask.net/8.3/others/imgfont.html',
However, my icon was not displayed on the screen.The attachment is the array file generated by my image processing program.How can I make it displayed in lvgl8.3 on my device?
// code start
LV_IMG_DECLARE(img_bluetooth_31);
static bool get_imgfont_path_lefticon(const lv_font_t * font, void * img_src,
uint16_t len, uint32_t unicode, uint32_t unicode_next)
{
LV_UNUSED(font);
LV_UNUSED(unicode_next);
LV_ASSERT_NULL(img_src);
if(unicode == 0xF617) {
memcpy(img_src, &img_bluetooth_31, sizeof(lv_img_dsc_t));
}
return true;
}
void lv_imgfont_lefticon_task(void)
{
lv_font_t * imgfont = lv_imgfont_create(55, get_imgfont_path_lefticon);
if(imgfont == NULL) {
LV_LOG_ERROR("imgfont init error");
return;
}
imgfont->fallback = LV_FONT_DEFAULT;
guider_ui.mainscreen_label_icon_left = lv_label_create(guider_ui.mainscreen);
lv_label_set_text(guider_ui.mainscreen_label_icon_left, "\uF617");
lv_obj_set_style_text_font(guider_ui.mainscreen_label_icon_left, imgfont, LV_PART_MAIN);
lv_obj_set_pos(guider_ui.mainscreen_label_icon_left, 0, 0);
lv_obj_set_size(guider_ui.mainscreen_label_icon_left, 785, 80);
lv_obj_set_style_text_color(guider_ui.mainscreen_label_icon_left, lv_color_hex(0x666666), LV_PART_MAIN);
}
XF_REG_TASK_DIV(500, 0, lv_imgfont_lefticon_task)
//code end