Hi,
I have recently ported my project into LVGL v9.2. I am facing an issue while trying to draw an image or icon, which is common for all my icons. I have converted the PNG icon into the BIN format with RGB565 color format and loaded it into the external memory.
When I draw the icon using an absolute path, such as “0:/to/the/path/my_icon.bin,” it renders perfectly. However, when I cache it into PSRAM and then attempt to draw it, I encounter a problem. The icon appears trimmed on the right side, while an extra area is displayed on the left side, as shown in the picture below.
Below is the property I am using to render the cache icon:
const lv_img_dsc_t music_img_ps = {
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.w = 52,
.header.h = 51,
.header.stride = 52 * 2,
.data_size = 52 * 51 * 2,
.header.cf = LV_COLOR_FORMAT_RGB565,
.header.flags = 0,
.data = (const uint8_t*)PSRAM_MUSIC_ADDR,
};
My function to draw the icon:
void draw_the_icon()
{
lv_obj_t *img_tst = lv_img_create(lv_scr_act());
lv_img_set_src(img_tst, &music_img_ps);
lv_obj_align(img_tst, LV_ALIGN_TOP_MID, 75, 250);
}
I am allocating 5316 bytes of memory for the caching which is the binary file size of the same icon.
Kindly, provide me with some ideas or techniques to overcome the same.
Thanks & regards,
Amaresh Ray