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 DilationFilter(); sourceImage = filter.processImage(sourceImage, worker, bitmaps); return(base.processImage(sourceImage, worker, bitmaps)); }
private void DilationToolStripMenuItem_Click(object sender, EventArgs e) { Filters filter = new DilationFilter(); backgroundWorker1.RunWorkerAsync(filter); }