private void methodRandomToolStripMenuItem_Click(object sender, EventArgs e) { Bitmap image2 = new Bitmap(openImage.Width, openImage.Height); int[,] histogram = Lab1.Extension(openImage, Lab1.Methods.Random); for (int i = 0; i < image2.Width; ++i) { for (int j = 0; j < image2.Height; ++j) { image2.SetPixel(i, j, Color.FromArgb(histogram[i, j], histogram[i, j], histogram[i, j])); } } OpenForm openForm = new OpenForm(image2); openForm.MdiParent = this; openForm.Text = "Methods.Random"; openForm.Show(); // ShowResult(Lab1.Extension(openImage, Lab1.Methods.Random), "Method Random"); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog openImageDialog = new OpenFileDialog(); openImageDialog.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*"; if (openImageDialog.ShowDialog() == DialogResult.OK) { try { openImage = new Bitmap(openImageDialog.FileName); OpenForm openForm = new OpenForm(openImage); openForm.MdiParent = this; openForm.Show(); } catch { DialogResult result = MessageBox.Show("ERROR", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }