Esempio n. 1
0
        private void dilationButton_Click(object sender, EventArgs e)
        {
            DilationFilter filter = new DilationFilter(structElement);

            backgroundWorker.RunWorkerAsync(filter);
            changeFiltersEnabled(true);
        }
Esempio n. 2
0
        private void closingButton_Click(object sender, EventArgs e)
        {
            DilationFilter firstFilter = new DilationFilter(structElement);

            backgroundWorker.RunWorkerAsync(firstFilter);
            extraOperation = "erosion";
            changeFiltersEnabled(true);
        }
Esempio n. 3
0
 private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (extraOperation == "erosion")
     {
         ErosionFilter firstFilter = new ErosionFilter(structElement);
         backgroundWorker.RunWorkerAsync(firstFilter);
         extraOperation = "none";
     }
     else if (extraOperation == "dilation")
     {
         DilationFilter firstFilter = new DilationFilter(structElement);
         backgroundWorker.RunWorkerAsync(firstFilter);
         extraOperation = "none";
     }
     else
     {
         pictureBox.Image = bmp.image;
         pictureBox.Refresh();
         changeFiltersEnabled(false);
     }
 }