private void menuItemContrast_Click(object sender, EventArgs e) { ContrastForm cFrm = new ContrastForm(); cFrm.ContrastValue = 0; if (cFrm.ShowDialog() == DialogResult.OK) { this.Cursor = Cursors.WaitCursor; imageHandler.RestorePrevious(); imageHandler.SetContrast(cFrm.ContrastValue); this.Invalidate(); this.Cursor = Cursors.Default; } }
private void menuItemContrast_Click(object sender, EventArgs e) { var histForm = new Histograms(); var cFrm = new ContrastForm(); if (cFrm.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; imageHandler.RestorePrevious(); imageHandler.SetContrast(cFrm.ContrastValue); Bitmap bmp = imageHandler.CurrentBitmap; histForm.AddRedHistogram(bmp); histForm.AddGreenHistogram(bmp); histForm.AddBlueHistogram(bmp); histForm.Show(); Invalidate(); Cursor = Cursors.Default; } }