コード例 #1
0
        private void oKButton_Click(object sender, EventArgs e)
        {
            int p1 = Convert.ToInt32(p1TextBox.Text);
            int p2 = Convert.ToInt32(p2TextBox.Text);
            int p3 = Convert.ToInt32(p3TextBox.Text);
            int p4 = Convert.ToInt32(p4TextBox.Text);
            int q2 = Convert.ToInt32(q2TextBox.Text);
            int q3 = Convert.ToInt32(q3TextBox.Text);
            int q4 = Convert.ToInt32(q4TextBox.Text);

            ShowResult(Lab2.OnePointOneArgumentOperation(openImage, name, p1, p2, p3, p4, q2, q3, q4));
            DrawHistoPQ(name, p1, p2, p3, p4, q2, q3, q4);
        }
コード例 #2
0
 public void DrawHistoPQ(string name, int p1, int p2, int p3, int p4, int q2, int q3, int q4)
 {
     int[] histo = Lab2.HistogramDifferences(name, p1, p2, p3, p4, q2, q3, q4);
     pqChart.Series.Add("PQ");
     pqChart.Series["PQ"].Points.Clear();
     pqChart.Legends.Clear();
     pqChart.ChartAreas[0].AxisX.Minimum = 0;
     pqChart.ChartAreas[0].AxisX.Maximum = 255;
     pqChart.ChartAreas[0].AxisY.Minimum = 0;
     pqChart.ChartAreas[0].AxisY.Maximum = 255;
     pqChart.Series["PQ"].BorderWidth    = 4;
     pqChart.Series["PQ"].ChartType      = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
     pqChart.Series["PQ"].ToolTip        = "X = #VALX{F1}, Y = #VALY{F1}";
     for (int i = 0; i < histo.Length; ++i)
     {
         pqChart.Series["PQ"].Points.AddXY(i, histo[i]);
     }
 }