public MainForm() { InitializeComponent(); SetAppearance(); queue = new Queue <double[]>(); InitConnection(); c1 = new Consumer(queue, lockObj, ws); comThread = new Thread(c1.consume); comThread.Start(); int scaleFactor = 2; int a = 85 * scaleFactor; int b = 85 * scaleFactor; double xMax = (a + b) * scaleFactor; g = panel1.CreateGraphics(); pen = new Pen(Color.Gray, 5); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; pen.StartCap = pen.EndCap = System.Drawing.Drawing2D.LineCap.Round; DT = new DrawingTools(a, b); DT.Init(); }