public Form1() { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; buffer = new byte[1 << 12]; graphics = pnBoard.CreateGraphics(); chessHelper = new ChessHelper(); chessHelper.graphics = graphics; }