Ejemplo n.º 1
0
        private void GenerateHistogramPoints()
        {
            RedHistogramPoints   = new System.Windows.Media.PointCollection();
            GreenHistogramPoints = new System.Windows.Media.PointCollection();
            BlueHistogramPoints  = new System.Windows.Media.PointCollection();

            int rMax = RedHistogram.Max();
            int gMax = GreenHistogram.Max();
            int bMax = BlueHistogram.Max();

            RedHistogramPoints.Add(new System.Windows.Point(0, rMax));
            GreenHistogramPoints.Add(new System.Windows.Point(0, gMax));
            BlueHistogramPoints.Add(new System.Windows.Point(0, bMax));

            for (int i = 0; i < 255; i++)
            {
                RedHistogramPoints.Add(new System.Windows.Point(i, rMax - RedHistogram[i]));
                GreenHistogramPoints.Add(new System.Windows.Point(i, gMax - GreenHistogram[i]));
                BlueHistogramPoints.Add(new System.Windows.Point(i, bMax - BlueHistogram[i]));
            }
            RedHistogramPoints.Add(new System.Windows.Point(255, rMax));
            GreenHistogramPoints.Add(new System.Windows.Point(255, gMax));
            BlueHistogramPoints.Add(new System.Windows.Point(255, bMax));

            OnPropertyChanged("RedHistogramPoints");
            OnPropertyChanged("BlueHistogramPoints");
            OnPropertyChanged("GreenHistogramPoints");
        }
Ejemplo n.º 2
0
 private void showRgbHistogram()
 {
     Refresh();
     RedHistogram.DrawGraphFrame();
     GreenHistogram.DrawGraphFrame();
     BlueHistogram.DrawGraphFrame();
     RedHistogram.DrawHistogramData(LookUpTablesSet.RedLUT);
     GreenHistogram.DrawHistogramData(LookUpTablesSet.GreenLUT);
     BlueHistogram.DrawHistogramData(LookUpTablesSet.BlueLUT);
 }