public void ReDraw() { this.lightness = trackBarLightness.Value; this.contrast = trackBarContrast.Value; LightFilter filter = new Cip.Filters.LightFilter(this.lightness, this.contrast); Raster newRaster = filter.ProcessWithoutWorker(raster); newRaster.ShowFilter(this.pBoxPreview); }
private void lightnessAndContrastToolStripMenuItem_Click(object sender, EventArgs e) { cipFormLightnessContrast form = new cipFormLightnessContrast(this.picBoxModifyed.Image,this.GetCurrentRaster()); if (form.ShowDialog()==DialogResult.OK) { int lightness = form.GetLightness(); int contrast = form.GetContrast(); if (!backgroundWorkerCip.IsBusy) { ImageFilter filter = new Cip.Filters.LightFilter(lightness, contrast); backgroundWorkerCip.RunWorkerAsync(filter); this.CalculateHistogram(); } } }