Example #1
0
        /// <summary>
        /// Display the histograms of the specific image
        /// </summary>
        /// <param name="image">The image to retrieve histogram from</param>
        /// <param name="numberOfBins">The number of bins in the histogram</param>
        public static void Show(IImage image, int numberOfBins)
        {
            HistogramViewer viewer = new HistogramViewer();

            viewer.HistogramCtrl.GenerateHistograms(image, numberOfBins);
            viewer.HistogramCtrl.Refresh();
            viewer.ShowDialog();
        }
Example #2
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
                if (_histogramViewer != null)
                {
                    _histogramViewer.Dispose();
                    _histogramViewer = null;
                }

                _imageBox.OnFunctionalModeChanged -= HandleFunctionalModeChange;
            }
            base.Dispose(disposing);
        }
Example #3
0
        private void showHistogramButton_Click(object sender, EventArgs e)
        {
            if (_imageBox.DisplayedImage == null)
            {
                MessageBox.Show(Properties.StringTable.PleaseLoadAnImageFirst);
                return;
            }

            if (_histogramViewer != null && _histogramViewer.Visible == false)
            {
                _histogramViewer.Dispose();
                _histogramViewer = null;
            }

            if (_histogramViewer == null)
            {
                _histogramViewer = new HistogramViewer();
                _histogramViewer.Show();
            }

            UpdateHistogram();
        }