private void PrepareResultsTab(Solution solution) { label14.Text = solution.path.Count.ToString(); // Image <Bgr, byte>[] tiles = BoardVisualizer.GetTiles ( boardRecognition.board_size, boardRecognition.original, pictureBox3.Width, pictureBox3.Height, false ); m_path = BoardVisualizer.VisualizeSolution ( solution, boardRecognition.board_size, boardRecognition.board_config, tiles ); // listBox1.Items.Clear(); string[] print_move = { "NONE", "RIGHT", "LEFT", "DOWN", "UP" }; for (int m = 0; m < solution.path.Count; m++) { listBox1.Items.Add(string.Format("{0:d}. {1:s}", m + 1, print_move[(int)solution.path[m]])); } listBox1.Items.Add("(-: SOLVED :-)"); // listBox1.SelectedIndex = 0; }
private void button3_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> original = new Image <Bgr, byte>(bmp); m_tiles = BoardVisualizer.GetTiles(boardRecognition.board_size, original, pictureBox2.Width, pictureBox2.Height, false); pictureBox1.Image = BoardVisualizer.OriginalBoardPreview(original, pictureBox1.Width, pictureBox1.Height, false).ToBitmap(); // this.Show(); rbfIsBeingShown = false; // boardRecognition.LearnTiles(original); EnablePage3(); button2.Enabled = true; }
private void DownloadCompleted(object sender, RunWorkerCompletedEventArgs e) { Image <Bgr, byte> original = (Image <Bgr, byte>)e.Result; m_tiles = BoardVisualizer.GetTiles(boardRecognition.board_size, original, pictureBox2.Width, pictureBox2.Height, false); pictureBox1.Image = BoardVisualizer.OriginalBoardPreview(original, pictureBox1.Width, pictureBox1.Height, false).ToBitmap(); progressBar1.Visible = false; progressBar1.MarqueeAnimationSpeed = 0; tabControl1.Enabled = true; // boardRecognition.LearnTiles(original); EnablePage3(); button2.Enabled = true; }
private void button4_Click(object sender, EventArgs e) { OpenFileDialog Openfile = new OpenFileDialog(); if (Openfile.ShowDialog() == DialogResult.OK) { textBox1.Text = Openfile.FileName; Image <Bgr, byte> original = new Image <Bgr, byte>(Openfile.FileName); m_tiles = BoardVisualizer.GetTiles(boardRecognition.board_size, original, pictureBox2.Width, pictureBox2.Height, false); pictureBox1.Image = BoardVisualizer.OriginalBoardPreview(original, pictureBox1.Width, pictureBox1.Height, false).ToBitmap(); // boardRecognition.LearnTiles(original); EnablePage3(); button2.Enabled = true; } }