Description
I want to draw a hollow rectangle (bounding box)
I have come up with some ideas, such as use lv_line and define the points, and use canvas.
According to my requirement, I would draw many bounding boxes with different sizes and positions.
To use lv_line, I need static points, but I don’t want to dynamically resize the array.
Therefore, I choose to use lv_canvas_draw_polygon to draw on the canvas.
I set the background to transparent and set the border width to draw a bounding box.
However, I don’t want the radius. (Based on the doc. “The border is drawn on top of the background. It has radius
rounding”.)
Is there any way that I can remove(change) the border-radius?
Or if there is a more efficient way to draw a bounding box, please let me know.
Many thanks for your help.
Code to reproduce
lv_draw_rect_dsc_t rect2;
lv_draw_rect_dsc_init(&rect2);
rect2.bg_opa = LV_OPA_TRANSP;
rect2.border_width = 30;
rect2.border_color = LV_COLOR_RED;
rect2.radius = 0;
uint32_t pad = 20;
lv_point_t po[] = {{x1-pad,y1-pad},{x1+width+pad,y1-pad},{x1+width+pad,y1+height+pad},{x1-pad,y1+height+pad},{x1-pad,y1-pad}};
lv_canvas_draw_polygon(canvas,po,5,&rect2);
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.