Beispiel #1
0
        // Selection changed in the histogram
        private void histogram_SelectionChanged(object sender, HistogramEventArgs e)
        {
            int min = e.Min;
            int max = e.Max;
            int count = 0;

            levelLabel.Text = min.ToString() + "..." + max.ToString();

            // count pixels
            for (int i = min; i <= max; i++)
            {
                count += activeHistogram.Values[i];
            }
            countLabel.Text = count.ToString();
            percentileLabel.Text = ((float)count * 100 / stat.PixelsCount).ToString("F2");
        }
Beispiel #2
0
        // Cursor position changed over the histogram
        private void histogram_PositionChanged(object sender, HistogramEventArgs e)
        {
            int pos = e.Position;

            if (pos != -1)
            {
                levelLabel.Text = pos.ToString();
                countLabel.Text = activeHistogram.Values[pos].ToString();
                percentileLabel.Text = ((float)activeHistogram.Values[pos] * 100 / stat.PixelsCount).ToString("F2");
            }
            else
            {
                levelLabel.Text = "";
                countLabel.Text = "";
                percentileLabel.Text = "";
            }
        }