private void BtnProcessClick(object sender, EventArgs e) { EndlessProgressBarFormInThread form = new EndlessProgressBarFormInThread( "Do Contour Tracing ... ", "Please wait, this takes a few seconds."); form.Start(); try { Bitmap b; // Todo FF: Hack for rectangle border and dilatation if (doDilatation) { int tmp = conGrap.LineRectStrength; conGrap.LineRectStrength = 1; b = conGrap.Apply(Processor.OriginalImage); conGrap.LineRectStrength = tmp; NSSimpleDilatation dilatation = new NSSimpleDilatation(); for (int i = 0; i < conGrap.LineRectStrength; i++) { b = dilatation.Apply(b); } } else { b = conGrap.Apply(Processor.OriginalImage); } ColorPalette.SetColorPalette(b); Processor.Change(b); lbContourNumbers.Text = conGrap.Contours.Count.ToString( CultureInfo.InvariantCulture); } catch (ArgumentException aex) { MessageBox.Show(aex.Message); BtnResetClick(sender, e); } form.End(); }
private void BtnProcessClick(object sender, EventArgs e) { EndlessProgressBarFormInThread form = new EndlessProgressBarFormInThread( "Do filtering ... ", "Please wait, this takes a few seconds."); form.Start(); try { Bitmap b = filter.Apply(Processor.OriginalImage); Helper.ColorPalette.SetColorPaletteToGray(b); Processor.Change(b); } catch (ArgumentException aex) { MessageBox.Show(aex.Message); BtnResetClick(sender, e); } form.End(); }