private void ContrastButton_Click(object sender, EventArgs e) { int brightness = (int)BrightnessBar.Value; int contrast = (int)ContrastBar.Value; Bitmap image = ConvertToBitmap(PictureBox1.Source as BitmapSource); image = imageOperation.ChangeAttributes(image, brightness, contrast); PictureBox1.Source = BitmapToImageSource(image); }
private void ContrastButton_Click(object sender, EventArgs e) { int brightness = BrightnessBar.Value; int contrast = ContrastBar.Value; Image image = PictureBox1.Image; Bitmap bitmap = new Bitmap(PictureBox1.Image); image = imageOperation.ChangeAttributes(bitmap, brightness, contrast); PictureBox1.Image = image; }