Description
What MCU/Processor/Board and compiler are you using?
Im using the ESP32 WROOM32
What LVGL version are you using?
version 9.3
What do you want to achieve?
I want to draw a line on the lvgl canvas. The canvas has a indexed color format(I4). Im able to draw pixels on the canvas with the lv_canvas_set_px() function.
What have you tried so far?
i tried to change the opacity and the color. im not able to change the color format to anything which needs more memory than I8. The canvas has a size if 200x320.
Code to reproduce
lv_obj_t *canvas = p_canvas;
lv_layer_t layer;
lv_point_precise_t point = {40, 50};
lv_point_precise_t last_point = {120, 200};
lv_draw_line_dsc_t line_dsc;
lv_draw_line_dsc_init(&line_dsc);
line_dsc.color = lv_color_make(0, 0, 3);
line_dsc.width = 10;
line_dsc.round_start = 1;
line_dsc.round_end = 1;
line_dsc.p1.x = 40;
line_dsc.p1.y = 50;
line_dsc.p2.x = 120;
line_dsc.p2.y = 200;
line_dsc.opa = LV_OPA_COVER;
lvgl_port_lock(-1);
lv_canvas_init_layer(canvas, &layer);
lv_draw_line(&layer, &line_dsc);
lv_canvas_finish_layer(canvas, &layer);
//This works
lv_canvas_set_px(canvas, 120, 120, lv_color_make(0, 0, 3), LV_OPA_COVER);
lv_canvas_set_px(canvas, 121, 121, lv_color_make(0, 0, 3), LV_OPA_COVER);
lv_canvas_set_px(canvas, 122, 122, lv_color_make(0, 0, 3), LV_OPA_COVER);
lv_canvas_set_px(canvas, 123, 123, lv_color_make(0, 0, 3), LV_OPA_COVER);
lvgl_port_unlock();