public override Bitmap processImage(Bitmap sourceImage, BackgroundWorker worker, Stack <Bitmap> bitmaps) { if (sourceImage == null) { MessageBox.Show("Откройте изображение"); return(null); } bitmaps.Push(sourceImage); Bitmap resultImage = new Bitmap(sourceImage.Width, sourceImage.Height); Filters filter = new ErosionFilter(); sourceImage = filter.processImage(sourceImage, worker, bitmaps); return(base.processImage(sourceImage, worker, bitmaps)); }
private void ErosionToolStripMenuItem_Click(object sender, EventArgs e) { Filters filter = new ErosionFilter(); backgroundWorker1.RunWorkerAsync(filter); }