private void OnClickBtnShowHistgram(object sender, EventArgs e) { if (m_bitmap == null) { return; } if (m_histgram != null) { m_histgram.Close(); m_histgram = null; m_histgram = new FormHistgramOxyPlot(); } m_histgram.BitmapOrg = (Bitmap) new Bitmap(m_strOpenFileName).Clone(); if (SelectGetBitmap(m_strCurImgName) != null) { m_histgram.BitmapAfter = (Bitmap)SelectGetBitmap(m_strCurImgName).Clone(); } m_histgram.DrawHistgram(); m_histgram.IsOpen = true; m_histgram.Show(); return; }
public void OnFormClosingFormMain(object sender, FormClosingEventArgs e) { if (m_tokenSource != null) { e.Cancel = true; } if (m_histgram != null) { m_histgram.Close(); m_histgram = null; } return; }
public void OnClickBtnFileSelect(object sender, EventArgs e) { ComOpenFileDialog openFileDlg = new ComOpenFileDialog(); openFileDlg.Filter = "JPG|*.jpg|PNG|*.png"; openFileDlg.Title = "Open the file"; if (openFileDlg.ShowDialog() == true) { pictureBoxOriginal.Image = null; pictureBoxAfter.Image = null; m_strOpenFileName = openFileDlg.FileName; try { LoadImage(); } catch (Exception) { MessageBox.Show(this, "Open File Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } pictureBoxOriginal.ImageLocation = m_strOpenFileName; btnStart.Enabled = true; textBoxTime.Text = ""; if (m_histgram == null) { m_histgram = new FormHistgramOxyPlot(); } else { m_histgram.Close(); m_histgram = null; m_histgram = new FormHistgramOxyPlot(); } m_histgram.BitmapOrg = (Bitmap) new Bitmap(m_strOpenFileName).Clone(); if (SelectGetBitmap(m_strCurImgName) != null) { m_histgram.BitmapAfter = (Bitmap)SelectGetBitmap(m_strCurImgName).Clone(); } m_histgram.DrawHistgram(); m_histgram.IsOpen = true; m_histgram.Show(); } return; }