private void showimage() { string si = i.ToString(); if (si.Length == 1) { si = "000" + si; } else if (si.Length == 2) { si = "00" + si; } else if (si.Length == 3) { si = "0" + si; } fn = fn.Replace(os, si); os = si; Bitmap B = PGMUtil.ToBitmap(fn); pictureBox1.Image = (Image)B; pictureBox1.Invalidate(); int s = fn.LastIndexOf('\\') + 1; this.Text = fn.Substring(s) + " (W: " + B.Width.ToString() + ", H: " + B.Height.ToString() + ")"; }
private void button1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); string fn = openFileDialog1.FileName; Bitmap B = PGMUtil.ToBitmap(fn); //this.Size = B.Size; pictureBox1.Image = (Image)B; int s = fn.LastIndexOf('\\') + 1; this.Text = fn.Substring(s) + " (W: " + B.Width.ToString() + ", H: " + B.Height.ToString() + ")"; }
private void BrowseButton_Clicked(object sender, EventArgs e) { //Clear Image pictureBox1.Image = null; //////////////////////////////////////////////////////////// //Browse OpenFileDialog BrowseImageDialog = new OpenFileDialog(); if (BrowseImageDialog.ShowDialog() == DialogResult.OK) { try { BrowsedImage = PGMUtil.ToBitmap(BrowseImageDialog.FileName); pictureBox1.Image = BrowsedImage; } catch { MessageBox.Show("Ops!\n Something went wrong!"); } } }
private void S_test_Click(object sender, EventArgs e) { Back_Propagation BP = new Back_Propagation(double.Parse(mse_threshold.Text), double.Parse(Learning_rate.Text), true); BP.SingleTest(ref Layers, ref singleTest_Label); if (singleTest_Label.Text == "closing eyes") { Bitmap B = PGMUtil.ToBitmap("Dataset\\Testing Dataset\\Closing Eyes\\BioID_0069.pgm"); //this.Size = B.Size; pictureBox2.Image = (Image)B; int s = fn.LastIndexOf('\\') + 1; this.Text = fn.Substring(s) + " (W: " + B.Width.ToString() + ", H: " + B.Height.ToString() + ")"; } if (singleTest_Label.Text == "looks down") { Bitmap B = PGMUtil.ToBitmap("Dataset\\Testing Dataset\\Closing Eyes\\BioID_0113.pgm"); //this.Size = B.Size; pictureBox2.Image = (Image)B; int s = fn.LastIndexOf('\\') + 1; this.Text = fn.Substring(s) + " (W: " + B.Width.ToString() + ", H: " + B.Height.ToString() + ")"; } if (singleTest_Label.Text == "looks front") { Bitmap B = PGMUtil.ToBitmap("Dataset\\Testing Dataset\\Looking Front\\BioID_0379.pgm"); //this.Size = B.Size; pictureBox2.Image = (Image)B; int s = fn.LastIndexOf('\\') + 1; this.Text = fn.Substring(s) + " (W: " + B.Width.ToString() + ", H: " + B.Height.ToString() + ")"; } if (singleTest_Label.Text == "looks left") { Bitmap B = PGMUtil.ToBitmap("Dataset\\Testing Dataset\\Looking Left\\BioID_0107.pgm"); //this.Size = B.Size; pictureBox2.Image = (Image)B; int s = fn.LastIndexOf('\\') + 1; this.Text = fn.Substring(s) + " (W: " + B.Width.ToString() + ", H: " + B.Height.ToString() + ")"; } }