private void BtnPreView_OnClick(object sender, RoutedEventArgs e) { if (imageProcess == null) { return; } if (imageMode) { List <string> list = new List <string>(); list.Add(TextBoxR.Text); list.Add(TextBoxG.Text); list.Add(TextBoxB.Text); TextBoxR.Text = ""; TextBoxG.Text = ""; TextBoxB.Text = ""; if (mode == 1) { imageProcess.LsbSte(list); } if (mode == 2) { imageProcess.DftSte(list); } if (mode == 3) { imageProcess.DctSte(list); } } else { List <string> list = new List <string>(); list.Add(TextBoxG.Text); TextBoxG.Text = ""; if (mode == 1) { imageProcess.LsbSte(list); } if (mode == 2) { imageProcess.DftSte(list); } if (mode == 3) { imageProcess.DctSte(list); } } CvInvoke.Imshow("Preview", imageProcess.MergeMat()); subText.Text = "平均修改像素比率: " + imageProcess.subCalculate() * 100 + "%"; magText.Text = "平均修改像素的幅度为: " + imageProcess.magCalculate(); MessageBox.Show("The steganography is done"); modeChange(); }