title: Efficient use of OnPaint
body: <p>I am programming in Visual Studio .Net and using C#.</p>
  
  <p>I am creating my own control that draws a wave based on values I get from an analog to digital converter (ADC).  I take the incoming points and convert them into X and Y points to properly draw the graph in my control.</p>
  
  <p>I have a loop inside my OnPaint method that goes through all the points and calls the DrawLine method between the current point and the next point.</p>
  
  <p>However, this is very inefficient as some of these graphs have 8192 points and the system actually has nine ADCs that I would like to show at the same time.  Every time the page redraws it takes almost a second for all graphs to redraw (especially during debug).</p>
  
  <p>On top of that, I have functionality that allows you to zoom in and pan across the waves to get a better view (acts a lot like google maps does) and all 9 waves zoom in and pan together.</p>
  
  <p>All of this functionality is very "jerky" because I am calling invalidate on mousewheel and mousemove.  Basically, it all works but not as smoothly as I would like.</p>
  
  <p>I was wondering if there were a way to create a predrawn object from the data and then just draw a dilated and translated version of the picture in the draw area.</p>
  
  <p>Any help would be greatly appreciated even if it is just pointing me in the right direction.</p>