/// <summary> /// Create Histograms /// </summary> private void CreateHistogram() { if (BitmapTemp != null) { BitmapTemp.Dispose(); } if (BitmapStretchTemp != null) { BitmapStretchTemp.Dispose(); } string color = this.comboBoxOptionOriginal.SelectedItem.ToString(); string colorMode = this.comboBoxModeOriginal.SelectedItem.ToString(); this.pictureBoxHistogramOriginal.Image = new Bitmap(1920, 1080); BitmapTemp = (Bitmap)this.pictureBoxHistogramOriginal.Image; using (var g = Graphics.FromImage(BitmapTemp)) g.Clear(Color.White); Histogram.Draw(BitmapTemp, colorMode, color); this.pictureBoxHistogramOriginal.Refresh(); if (this.isStretched) { this.pictureBoxHistogramStretched.Image = new Bitmap(1920, 1080); BitmapStretchTemp = (Bitmap)this.pictureBoxHistogramStretched.Image; using (var g = Graphics.FromImage(BitmapStretchTemp)) g.Clear(Color.White); HistogramStretched.Draw(BitmapStretchTemp, colorMode, color); this.pictureBoxHistogramStretched.Refresh(); } }