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]); } }