New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draw line using VG-Lite #6201
Comments
Hi. Are you able to draw the line segments without a mask? i.e. start the lines from where the inner mask's edge would be and end the lines where the outer mask's edge would be? If it's too difficult to align the ends of the lines nicely, could you draw something else like a |
See this issue for comments from NXP on this topic.
What about having an image with the ticks and setting it as the background of an arc. The arc will mask out parts of the image as you adjust it's angles/value. It should be much faster than drawing the ticks one by one. |
The problem is that the design should have one color for ON ticks and another for OFF tick. I solved this by drawing a line with a different color on a canvas on top of already drawn lines.
So, I will have to draw the inner and outer arcs every time I redraw the tick with the different color, correct? It is possible, as long the lines and arcs are drawn by vglite. I will try it. |
Can you send an image about how the result should look like? |
You can try this: lv_obj_set_style_arc_image_src(arc, &img, LV_PART_MAIN);
lv_obj_set_style_arc_opa(arc, LV_OPA_50, LV_PART_MAIN);
lv_obj_set_style_arc_image_src(arc, &img, LV_PART_INDICATOR); |
LVGL version
v8.3.1
What happened?
I want to draw multiple lines using GPU. I use NXP MIMXRT1176 which has VG-Lite.
The final result shall be an arc, drawn using short thin lines, like ticks, with constant radius from the center. I took the inspiration from the lv_meter widget.
To draw lines, I use inner and outer circular masks and draw the lines started from the center of the circle and end up right about the outer mask. This method draws all those pixels which are in-between the two circular masks.
I draw these lines upon changes in encoder, like a volume control. So I need these lines to be drawm efficiently and fast enough. My problem is that using lvgl 8.3.1 I cannot do it at all using VG-Lite because of the following code in lv_draw_vglite.c:
Meaning, if I have any masks at all, LVGL uses software to draw the lines instead of GPU. Software method is extremelly slow.
In LVGL 9 I didn't see such condition, so, I tried to to use it. Unfortunatelly, LVGL 9.x does not support VG-Lite 3.x, which basically is supported currentnly by the latest NXP SDK.
What are my options (except maybe waiting for the NXP SDK which is planned to support VG-Lite 4.x)?
How to reproduce?
No response
The text was updated successfully, but these errors were encountered: