Example #1
0
 internal void ReapplyFilters()
 {
     if (this.currentDicomElement != null)
     {
         Bitmap bmp = this.visibleImage.Clone() as Bitmap;
         if (!imageSettings.IsDefaultBrightness())
         {
             BrightnessCorrection filter = new BrightnessCorrection(imageSettings.Brightness);
             bmp = filter.Apply(bmp);
         }
         if (!imageSettings.IsDefaultContrast())
         {
             ContrastCorrection filter = new ContrastCorrection(imageSettings.Contrast);
             // apply filter
             bmp = filter.Apply(bmp);
         }
         previewBox.Image = bmp;
     }
 }
Example #2
0
        private void Contrast_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            ContrastLabel.Content = Contrast.Value;
            contrast = (int)Contrast.Value;

            if (mainPhoto != null)
            {
                cc = new ContrastCorrection(contrast);
                System.Drawing.Bitmap tmp = cc.Apply((System.Drawing.Bitmap)mainPhoto.Clone());
                BitmapImage tmpBmpIs = ToBitmapImage(tmp);

                Photography.Source = ToBitmapImage(tmp);

                UpdateHistograms(tmp);
                UpdateChannelPreviews(tmp);
            }
        }