Correct way to update canvas with lots of objects (raspberry pi)

14 views
Skip to first unread message

Rodolfo Baeza

unread,
Apr 17, 2018, 12:51:57 PM4/17/18
to Kivy users support
Hello,

I'm developing a dashboard-like application for the raspberry pi using Kivy.
This application reads values from the serial port (list of 512 hex numbers) and then draws them in the screen using rectangles (like a bar chart), two rectangles for each value. I added a clock schedule to refresh the values every 0.5 of seconds, but it's slow to repaint. I'm clearing the canvas and then drawing the values inside a for loop.

Any advice if there's any better way to do it? or is it a known limitation of kivy in devices like the raspberry?

Thanks.

Alexander Taylor

unread,
Apr 21, 2018, 8:17:14 AM4/21/18
to Kivy users support
Instead of clearing the canvas, keep references to the Rectangles and reset their pos and size to what you want. This should be very significantly faster, clearing the canvas is just not the right way to update things.
Reply all
Reply to author
Forward
0 new messages