More ideal/efficient way of drawing pixels on a canvas
Hello, I'm trying to build a sort of whiteboard application with Avalonia. I'm new to Avalonia and .NET in general but want to use this project to learn.
So currently I have a simple canvas and using Xiaolin Wu's Line Algorithm I'm drawing lines on the canvas by placing small rectangles (simulating pixels) on it when the mouse is clicked and drawn on the canvas.
This works fine to an extent but the whole line-drawing process bogs down after the canvas is populated a fair bit, I can imagine this is because my way of handling it is inefficient, after all I'm just adding numerous small rectangles as children of the canvas.
I'm looking for a more ideal way of doing this whole drawing process.
From the research I've done, bitmaps keep popping up so I think I'll go learn about them but if there are any suggestions, I'd like to hear them
So currently I have a simple canvas and using Xiaolin Wu's Line Algorithm I'm drawing lines on the canvas by placing small rectangles (simulating pixels) on it when the mouse is clicked and drawn on the canvas.
This works fine to an extent but the whole line-drawing process bogs down after the canvas is populated a fair bit, I can imagine this is because my way of handling it is inefficient, after all I'm just adding numerous small rectangles as children of the canvas.
I'm looking for a more ideal way of doing this whole drawing process.
From the research I've done, bitmaps keep popping up so I think I'll go learn about them but if there are any suggestions, I'd like to hear them
