예제 #1
0
        private void гистограммаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _ = new GrayScale();
            int[][] histogram = new int[3][];
            histogram[0] = new int[256];
            histogram[1] = new int[256];
            histogram[2] = new int[256];
            for (int x = 0; x < image.Width; x++)
            {
                for (int y = 0; y < image.Height; y++)
                {
                    Color sourceColor = image.GetPixel(x, y);
                    histogram[0][sourceColor.R]++;
                    histogram[1][sourceColor.G]++;
                    histogram[2][sourceColor.B]++;
                }
            }
            Form2 histogramView = new Form2();

            histogramView.ShowRGBHistogram(histogram);
        }