Task.Factory.StartNew( () => { using (Graphics g = this.CreateGraphics()) { Pen p = new Pen(Color.SaddleBrown,15); g.DrawLine(p, 40, 400, 200, 400); g.DrawLine(p, 73, 90, 300, 90); g.DrawLine(p, 40, 400, 200, 400); //do your drawing routines here } //invoke an action against the main thread to get the graphics on the form this.Invoke( new Action(() => { })); });
Comments