private void erodeToolStripMenuItem1_Click(object sender, EventArgs e) //Erode { if (img == null) // verify if the image is already opened { return; } Cursor = Cursors.WaitCursor; // clock cursor //copy Undo Image imgUndo = img.Copy(); MIplImage s = imgUndo.MIplImage; ImageClass.Erode(img, imgUndo); ImageViewer.Image = img.Bitmap; ImageViewer.Refresh(); // refresh image on the screen Cursor = Cursors.Default; // normal cursor }