Exemplo n.º 1
0
        private void button8_Click(object sender, EventArgs e)
        {
            if (rbfIsBeingShown)
            {
                return;
            }
            rbfIsBeingShown = true;
            this.Hide();
            //
            Bitmap bmp = capture.ShowRubberBandForm();

            if (bmp == null)
            {
                this.Show();
                rbfIsBeingShown = false;
                return;
            }
            Image <Bgr, byte> shuffled = new Image <Bgr, byte>(bmp);

            //
            this.Show();
            rbfIsBeingShown = false;
            //
            try
            {
                boardRecognition.ClassifyTiles(shuffled);
                //
                textBox4.Text     = boardRecognition.ConfigToString();
                pictureBox2.Image = BoardVisualizer.ShuffledBoardPreview
                                    (
                    boardRecognition.board_size,
                    boardRecognition.board_config,
                    m_tiles
                                    ).ToBitmap();
                //
                button9.Enabled = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
 private void button12_Click(object sender, EventArgs e)
 {
     try
     {
         boardRecognition.ReadConfiguration(textBox4.Text);
         //
         pictureBox2.Image = BoardVisualizer.ShuffledBoardPreview
                             (
             boardRecognition.board_size,
             boardRecognition.board_config,
             m_tiles
                             ).ToBitmap();
         //
         button9.Enabled = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }