Any way to instantly render Graphics.DrawRectangle and retain previous rectangles?
I am creating an indicator that is DOM like which displays on the right side of a chart
I am using graphics.DrawRectangle and graphics.DrawString to accomplish the display
But as time goes on the number of items to draw will increase
I am concerned it will start to consume far too much CPU
Is there a way to use these draw methods to instantly draw on the screen, not just on a refresh? This way only the newest graphics is rendered, instead of the needing to run through the my entire display graphics entity list again.
For example at price Y draw a box with the price in it at x = xlocation
when price changes to Y + 1 tick, draw another box above the previous box (at new price level )but still at x = xlocation
As my code is today, I need to draw 2 boxes when price changes.
I want to draw just 1 to reduce CPU impact
I would only draw 2 if a full refresh occurs (such as when F5 is pressed)
The impact is minimal for the low level direct draw routines, you can draw hundreds with little impact, and also remember that the Plot routine is typically called at user speed (e.g. 0.4/0.5s) so it's not a big deal.
The following user says Thank You to ratfink for this post: