コード例 #1
0
        private void DrawNumber(int number, Color background, Pen drawColor, bool drawRectangle)
        {
            int n      = number - 1;
            int column = n % 11;
            int row    = (n - column) / 11;

            board[row, column].BackgroundImage = BitmapGenerator.GenerateNumberImage(40, 40, number, boardPanel.Margin.Left, background, drawColor, drawRectangle);
            Application.DoEvents();
            Thread.Sleep(200);
        }
コード例 #2
0
 private void ResetBoard()
 {
     for (int i = 0; i < 12; i++)
     {
         for (int j = 0; j < 11; j++)
         {
             board[i, j].BackgroundImage = BitmapGenerator.GenerateNumberImage(40, 40, i * 11 + j + 1, boardPanel.Margin.Left, Color.White, Pens.Black, false);
         }
     }
     board[0, 0].BackgroundImage = BitmapGenerator.GenerateDiasbleChessCellBoardImage(40, 40);
 }
コード例 #3
0
        private void InitializeBoard()
        {
            Panel p;

            for (int i = 0; i < 12; i++)
            {
                for (int j = 0; j < 11; j++)
                {
                    p      = new Panel();
                    p.Dock = DockStyle.Fill;
                    //p.BackgroundImage = BitmapGenerator.GenerateNumberImage(40, 40, i * 11 + j + 1, boardPanel.Margin.Left, Color.White, true);

                    p.BackgroundImage = BitmapGenerator.GenerateDiasbleChessCellBoardImage(40, 40);
                    boardPanel.Controls.Add(p, j, i);
                    board[i, j] = p;
                }
            }
        }