Example #1
0
        public static Bitmap GetBoardImage(string fen, bool withCellIndentity = true)
        {
            var ctrl = new BoardControl();
            ctrl.StartNew(new Player(), new Player(), fen);
            ctrl.BackColor = Color.Black;

            var bmp = new Bitmap(850, 850);
            ctrl.DrawToBitmap(bmp, new Rectangle(Point.Empty, Size.Add(bmp.Size, new Size(-15, -15))));
            return bmp;
        }
Example #2
0
        internal void StartPlayer(BoardControl sourceBoardControl, Sensors.SensorContainer sensorContainer)
        {
            sw = System.Diagnostics.Stopwatch.StartNew();
            sensorContainer.SensorDataReceived += sensorContainer_SensorDataReceived;

            sourceBoardControl.GameStarted += sourceBoardControl_GameStarted;
            sourceBoardControl.MessageShowed += sourceBoardControl_MessageShowed;
            try
            {
                this.Invoke(this.boardControl.Show);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            this.KeyDown -= SidePlayer_KeyDown;
            this.KeyDown += SidePlayer_KeyDown;
        }