/// <summary> /// For bitton "Compute more steps". /// Method starts computing more steps of edge relaxation algorithm. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MultipleEdgeRelaxationInImage(object sender, EventArgs e) { if (firstLoop == false) { MessageBox.Show("No preprocessing for edge relaxation.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { int numberOfLoops = int.Parse(loops.Text); if (numberOfLoops <= 0) { MessageBox.Show("Number of loops must be greater than zero.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (newRelax != null) { oldRelax = (Bitmap)newRelax.Clone(); } newRelax = EdgeRelaxation.EdgeRelaxationLoop(numberOfLoops); invalidateNewImage(newRelax); } catch { MessageBox.Show("Count of loops must be a number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
/// <summary> /// For button "One more step". /// Method starts computing one loop of edge relaxation algorithm. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SingleEdgeRelaxationInImage(object sender, EventArgs e) { if (firstLoop == false) { MessageBox.Show("No preprocessing for edge relaxation.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (newRelax != null) { oldRelax = (Bitmap)newRelax.Clone(); } newRelax = EdgeRelaxation.EdgeRelaxationLoop(1); invalidateNewImage(newRelax); }