I'm working on a college project (simulation) that needs to draw a lot of lines and objects to a custom UserControl
. My current approach is just to redraw everything for every tick / update loop using Invalidate()
. But it sure needs a lot of time to draw (which is resulting in very low FPS) especially when I need to draw thousands of lines and rectangles.
So how can I only re-draw a specific (group of) objects that move in every update loop and only re-draw the rest (the rarely updated objects) when needed? Or is there other way to optimize the way I draw in this problem?