private void btnWavelet_Click(object sender, EventArgs e) { int p; //значение порога try { p = int.Parse(textBoxWavelet.Text.ToString()); if (p <= 0) { throw new Exception(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error of wavelet's threshold value!"); return; } //переход в серое //btnMakeGray.PerformClick(); currBit = WaveletAndRetouch.waveletFilter(currBit, currBit.Width / (waveletCount + 1), p); //переход на вейвлет: waveletCount++; pictureBox1.Image = (Image)currBit; pictureBox1.Refresh(); }
private void btnRevWavelet_Click(object sender, EventArgs e) { //переход на вейвлет: if (waveletCount == 0) { MessageBox.Show("Check your actions!", "The Wavelet filter hasn't been used on the image!"); return; } currBit = WaveletAndRetouch.reverseWavelet(currBit, currBit.Width, waveletCount); waveletCount--; pictureBox1.Image = (Image)currBit; //доп.обработка: btnFindWrong.PerformClick(); btnPerformRet.PerformClick(); btnFindWrong.PerformClick(); btnPerformRet.PerformClick(); pictureBox1.Refresh(); }