micropython-ili9341 icon indicating copy to clipboard operation
micropython-ili9341 copied to clipboard

show() function

Open Rickroller01 opened this issue 1 year ago • 3 comments

Is there a way to implement manually updating the display similar to the show() function in the ssd1306 library. My guess is adding another buffer to the Block() function.

Rickroller01 avatar Oct 12 '24 16:10 Rickroller01

This issue is similar to https://github.com/rdagger/micropython-ili9341/issues/35#issue-2568191496

rdagger avatar Oct 12 '24 17:10 rdagger

This issue is similar to #35 (comment)

I have noticed that. Will I be able to replace the block function with an extra framebuffer then add a show() function that is basically the block function?

Rickroller01 avatar Oct 13 '24 10:10 Rickroller01

Improving the library properly will take some work. A simple approach would be to modify the block function to draw to a framebuffer and then add a show method, but this wouldn't fully take advantage of the performance benefits offered by the framebuffer class.

In MicroPython v1.20.0, several useful framebuffer methods were added, such as ellipse, poly, and rect (with a new fill option). These methods are implemented in C, making them significantly faster and more efficient than their Python equivalents.

To improve the library properly, a secondary set of shape-drawing methods should be added to fully leverage these native framebuffer methods. This would provide the best performance and functionality by taking advantage of the underlying C implementations.

However, this functionality is already achievable by directly creating a framebuffer, drawing on it using the native methods, and then using the display.draw_sprite method to transfer the framebuffer to the display.

rdagger avatar Oct 13 '24 16:10 rdagger