Description
I know I can use the online image converter to convert a png to a C array and I know there is a offline version, but I can’t use that from iOS. I also know you can use a file but I only have SPI flash to use, which I think I can use based on this discussion. I read another thread about fabricating the data structure of the c array.
So I can either copy the file to SPI memory and somehow use the use the file method or try to fabricate the c array in some other way. I would think sending down the png file, storing the data in SPI, and somehow using it as a file method, since lvgl can interpret a png file.
Any direction or assets would be a great help.
What MCU/Processor/Board and compiler are you using?
Arduino, ST7789, nRF52, SPI
What LVGL version are you using?
8.3.5
What do you want to achieve?
I want to send a png via ble to my board and display it.
What have you tried so far?
I can convert the image to a C array using the online image converter and display it. I can connect to the board using ble and send a text message.
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
LV_IMG_DECLARE(icon9);
lv_obj_t *gtLabel;
lv_obj_t *gtIcon;
void screen_message(char* blemessage)
{
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_black(), LV_PART_MAIN);
gtIcon = lv_img_create(lv_scr_act());
lv_obj_align(gtIcon, LV_ALIGN_CENTER, 0, 0);
/*From variable*/
lv_img_set_src(gtIcon, &icon9);
//Create a white label, set its text and align it to the center
gtLabel = lv_label_create(lv_scr_act());
lv_label_set_text(gtLabel,blemessage);
//lv_label_set_text(label,display_message);
lv_obj_set_style_text_color(lv_scr_act(), lv_color_white(), LV_PART_MAIN);
lv_obj_set_style_text_font(gtLabel,&lv_font_montserrat_24,0);
//lv_obj_align(gtLabel, LV_ALIGN_CENTER, 0, 0);
lv_obj_align_to(gtLabel, gtIcon, LV_ALIGN_OUT_TOP_MID, 0, -10);
}