private void btn_shaping_Click(object sender, EventArgs e) { try { shapinForm sForm = new shapinForm(); if (sForm.ShowDialog() == DialogResult.OK) { imageProcessing.HistogramMatching(curBitmap, sForm.GetmatchingBmp, out curBitmap); } Invalidate(); } catch (NullReferenceException exp) { MessageBox.Show("请选择图片"); } catch (Exception exp) { MessageBox.Show(exp.Message); } }