Ejemplo n.º 1
0
        // Selection changed in the hostogram
        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");
        }
Ejemplo n.º 2
0
        // Cursor position changed over the hostogram
        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 = "";
            }
        }
Ejemplo n.º 3
0
        // Selection changed in the hostogram
        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");
        }
Ejemplo n.º 4
0
        // Cursor position changed over the hostogram
        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 = "";
            }
        }