Example of LVGL 9 image header

Hi

That seems to be an issue with the compiler, assuming you are using LVGL 9 and C compiler, that should be valid.

This Using images in LVGL, getting “error: expected primary-expression before ‘.’ token” - My projects - LVGL Forum points that could be something related to using a C++ compiler instead of C compiler for the image file.

You can try what is suggested in the thread, to change the order of the fields in the initialization structure, not sure if it will solve, but seems to be some issue with c++ compilers.

An image with:

const lv_image_dsc_t img_test1 = {
  .header.cf = LV_COLOR_FORMAT_RGB565,
  .header.magic = LV_IMAGE_HEADER_MAGIC,
  .header.w = 82,
  .header.h = 82,
  .data_size = 6724 * 2,
  .data = img_test1_map,
};

Is successfully compiled with a C compiler (either on PC, STM32 with GCC, or ESP-IDF).