Description
What MCU/Processor/Board and compiler are you using?
ARM A7
What LVGL version are you using?
V8.4.0
What do you want to achieve?
I want to copy the decoded image data to canvas for direct display
What have you tried so far?
/*This is displayed correctly, but it does not meet my requirements.
The copied data is ARGB8888 because lv_comf. h is also configured with
# define LV-COLOR_dePTH 32, but I can only provide RGB565 data to canvas
*/
//static lv_color_t cbuf[640* 480* 4];
static lv_color_t cbuf[LV_CANVAS_BUF_SIZE_TRUE_COLOR(640, 480)];
lv_obj_t * canvas = lv_canvas_create(lv_scr_act());
lv_canvas_set_buffer(canvas, cbuf, 640, 480, LV_IMG_CF_TRUE_COLOR);
/*
When I made the following configuration, the canvas control displayed the "no data" character in the upper left corner,
and the log displayed "[Warn] (1.381,+658) lv_img_decoder_built_in_open: Image decoder open: unknown color format (in lv_img_decoder. c line # 464)
[Warn] (1.381, +0) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (1.381, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #84)"
*/
static lv_color_t cbuf[640* 480*2];
lv_obj_t * canvas = lv_canvas_create(lv_scr_act());
lv_canvas_set_buffer(canvas, cbuf, 640, 480, LV_IMG_CF_RGB565);
lv_canvas_copy_buf(canvas, imgFrame->mRGB565Data, 0, 0, 640, 480);//imgFrame->mRGB565Data size is 614400 == cbuf size
//So, can't other lv_img_cf_t be set? Does it have to be consistent with LV-COLOR_DEPTH of lv_comf. h?
//What I passed in is already the original RGB565 data, why does it still trigger LVGL decoding