Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 15th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Flickering on winform UI
  2. private void DrawRadarLines()
  3.     {
  4.         myPen = new Pen(Color.Red, 2);
  5.         formGraphics = radarMap.CreateGraphics();
  6.  
  7.         for (int i = 0; i < sensorNetworkNum * 5; i++)
  8.         {
  9.             formGraphics.DrawLine(myPen,
  10.                 (float)(195 - radarMapLines[i, 0] * scalingFactor),
  11.                 (float)(195 - radarMapLines[i, 1] * scalingFactor),
  12.                 (float)(195 - radarMapLines[i, 2] * scalingFactor),
  13.                 (float)(195 - radarMapLines[i, 3] * scalingFactor));
  14.         }
  15.  
  16.         myPen.Dispose();
  17.         formGraphics.Dispose();
  18.     }