Replies: 1 comment
-
Break up the overall area into a grid with individual controls for each tile. Then clear and redraw only the tiles that are affected by the change. When drawing each tile use transforms so the drawing operations remain consistent and use rectangle intersections to skip operations that are not relevant. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you for such an awesome project!
I am currently building my own UI (in a Winforms project) using SkiaSharp by manually drawing images, buttons and other controls.
Right now I have a single SKGLControl that I Clear and then redraw the UI into everytime something (like a text etc) changes. This works great and the performance seems good so far. But I can imagine that as my UI gets more complex it could get too expensive redrawing the entire canvas each time something small like a text label changes.
So what would be the optimal way to redraw only parts of the canvas? One solution is ofc to have multiple SKGLControls but I rather keep it to a single SKGLControl to avoid the added cost of a Winforms control for every small UI element.
Could I for example have multiple "sub canvases" or something like that so that each control in essence could be given it's own canvas and be invalidated on its own?
Thank you to anyone who can enlighten me :D
Beta Was this translation helpful? Give feedback.
All reactions