I have drawn a snapshot of google maps on my screen using lv_image widget.
Now I would like to draw some red circles on my map to indicate the location on the map.
Do you have any advice on how to do this ? Which widget should I use ?
Should I modify somehow the existing image or draw something on top of it ?
What MCU/Processor/Board and compiler are you using?
Hello, AZ_Renesas, funny to see you here as well as on the Renesas Community…
Anyway, I figure this is what you’re looking for: Canvas (lv_canvas) — LVGL documentation
Another option is to draw the circles on the top layer by setting lv_layer_top() as their parents upon creation, but then you cannot move the image around with the circles on top.
For drawing circles, the easiest option would be to create an empty object and setting it’s radius style to LV_RADIUS_CIRCLE and the border width/color styles accordingly.
I must admit I have never used the canvas before, but looking at the examples on the documentation, I believe you will have to add the image to the canvas as a layer: Canvas (lv_canvas) — LVGL documentation (links to example).
I believe after this step you may be able to use lv_canvas_set_px() and actually see your changes, currently you have the image as a child of the canvas object which means it overlaps the drawing area of the canvas, your pixels are probably just not visible right now.
For testing purposes you may want to try not calling lv_image_create() at all and seeing if lv_canvas_set_px()does what you expect.
As far as I understand you can simple draw base object with rounded corners, red border of none-zero width and transparent background. You just need to create an image first and then an object to control their location