protected override void brightenToolStripMenuItem_Click(object sender, EventArgs e) { if (imageList == null) { MessageBox.Show(this, Properties.Resources.LoadImage, strProgName); return; } TrackbarDialog dialog = new TrackbarDialog(); dialog.LabelText = Properties.Resources.Brightness; dialog.ValueUpdated += new TrackbarDialog.HandleValueChange(UpdatedBrightness); originalImage = imageList[imageIndex]; stack.Push(originalImage); if (dialog.ShowDialog() == DialogResult.Cancel) { // restore original image imageList[imageIndex] = originalImage; this.pictureBox1.Image = new Bitmap(originalImage); } }
private void UpdatedContrast(object sender, TrackbarDialog.ValueChangedEventArgs e) { Image image = ImageHelper.Contrast(originalImage, e.NewValue * 0.04f); if (image != null) { imageList[imageIndex] = image; this.pictureBox1.Image = new Bitmap(image); } }