private void OpenForm_Load(object sender, EventArgs e) { if (openImage != null) { pictureBox1.Image = openImage; int[] histo = Lab1.CountHisto(openImage); DrawHisto(histo); } }
private void histogramPictureBox_MouseClick(object sender, MouseEventArgs e) { x1 = e.X; y1 = e.Y; ChangeImage(x1, y1); MakeNewImage(); newImagechart.Series.Clear(); int[] histogr = Lab1.CountHisto(new Bitmap(newImagePictureBox.Image)); DrawHisto(histogr); histogramPictureBox.Invalidate(); }
public void DrawHisto(Bitmap bmp) { int[] histo = Lab1.CountHisto(bmp); newChart.Series.Add("Gray"); newChart.Series["Gray"].Points.Clear(); newChart.Legends.Clear(); newChart.ChartAreas[0].AxisX.Minimum = 0; newChart.ChartAreas[0].AxisX.Maximum = 255; newChart.Series["Gray"].BorderWidth = 5; newChart.Series["Gray"].ToolTip = "X = #VALX{F1}, Y = #VALY{F1}"; for (int i = 0; i < histo.Length; ++i) { newChart.Series["Gray"].Points.AddXY(i, histo[i]); } }
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"); }