private void gradToolStripMenuItem_Click(object sender, EventArgs e) { temp_image = new Bitmap(pictureBox1.Image); Filters filter = new GradFilter(); backgroundWorker1.RunWorkerAsync(filter); }
private void gradToolStripMenuItem_Click(object sender, EventArgs e) { GradFilter filter = new GradFilter(); Bitmap newImage = filter.ProcessImage(image); if (backgroundWorker1.CancellationPending != true) { image = newImage; } pictureBox1.Image = image; pictureBox1.Refresh(); }