Drawing using LVGL #218
-
I would like to thank René for his great work, and I really enjoy working with this library! However, in comparison to the external libraries mentioned (TFT_eSPI or LovyanGFX), I miss the ability to do drawing. For instance TFT_eSPI provides functions like
Using the additional library TFTShape of androdlang, even polylines, polygons, grids, splines, stars and n-gons can be drawn using TFT_eSPI. Since LVGL version 9.x is now integrated into esp32-smartdisplay (another big step forward, thanks to René), ThorVG, which is now part of LVGL, also contains vector-oriented drawing functions. However, I did not manage to squeeze this library into the existing memory. My question is now: Has anyone been able to successfully use ThorVG on one of the Sunton boards? Or does anyone have any knowledge of where drawing functions exist or could be created that are based on LVGL? My goal is to draw vector data from OpenStreetMap for a GPS application. I would need to draw polylines of different width and color and filled polygons (preferably also concave ones) of different colors. I know my question is kind of off-topic here, I hope you forgive me. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hi Polarkernel, I believe SVG is supported in LVGL. SVG has all these vector definitions and this might be a solution! |
Beta Was this translation helpful? Give feedback.
-
Hi René I always thought that SVG was included in ThorVG. After your comment, I found out that there is a separate library libs/svg in lvgl version 9.2.2 on GitHub. But the lvgl code automatically loaded by your library doesn't load this library and also doesn't load the corresponding template file lv_conf_template.h. The loaded template file does say to be Configuration file for v9.2.2, but the definition Thanks for your hint, I will try to install this library manually, eventually, it could easily solve my problem.
I tried to implement a given example, but the linker wasn't able to fit it into the memory (4 MB) of my board (esp32-2432W328C): That is what I meant by this sentence in my initial question. |
Beta Was this translation helpful? Give feedback.
-
It is strange, I am not able to load the SVG library. The version 9.2.2. of LVLG that platformio loads when I use smartdisplay is different from the version provided on GitHub. The lvgl/src/libs/svg library does not exist. When I replace the LVGL code with the GitHub version (when VS Code is running) and then try to build my program, this library is automatically replaced with the old version (by platformio, I assume):
I have no idea what the origin of this version is. I give up for now. It is a pity that LVGL does not provide primitive functions like |
Beta Was this translation helpful? Give feedback.
-
Well, there are also functions like:
So this can also be done using LVGL! |
Beta Was this translation helpful? Give feedback.
-
I already knew that, thanks, and I already had a working version using It seems that vector drawing is implemented in version 9.2.2 of LVGL. However, I cannot access it. It irritates me that the version of LVGL loaded by platformio and the version on GitHub are different, although they show the same version number. However, since my knowledge of the hardware is also very limited, I do not want to evaluate it more deeply. Maybe it will be fixed in future versions. |
Beta Was this translation helpful? Give feedback.
-
@polarkernel You can use the github version of LVGL by changing this in the library: library.json. Here change the dependencies to the github repo! BTW: It is already LVGL 9.2.2 Maybe something needs to be included in the lvgl configuration? |
Beta Was this translation helpful? Give feedback.
-
I think I found the reason for the observed difference. I get LVGL version 9.2.2, when I build with one of the following methods, which do the same for LVGL:
But when I build with
then the library manager reports:
This means, that the master branch of LVGL on GitHub is the development version 9.3.0 and not 9.2.2, which is the release version. SVG is not yet implemented in version 9.2.2, but in the new version, which has not yet been released. This knowledge scares the spirits away and the fog is lifted! |
Beta Was this translation helpful? Give feedback.
I think I found the reason for the observed difference. I get LVGL version 9.2.2, when I build with one of the following methods, which do the same for LVGL:
But when I build with
then the library manager reports:
This means, that the master branch of LVGL on GitHub is the development version 9.3.0 and not 9.2.2, which is the relea…