/// <summary> /// ファイル選択ボタンのクリックイベント /// </summary> /// <param name="sender">オブジェクト</param> /// <param name="e">イベントのデータ</param> private 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) { pictureBox.Image = null; m_strOpenFileName = openFileDlg.FileName; pictureBox.ImageLocation = m_strOpenFileName; } 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; }
/// <summary> /// ファイル選択ボタンのクリックイベント /// </summary> /// <param name="sender">オブジェクト</param> /// <param name="e">ルーティングイベントのデータ</param> private void OnClickBtnFileSelect(object sender, RoutedEventArgs e) { ComOpenFileDialog openFileDlg = new ComOpenFileDialog(); openFileDlg.Filter = "JPG|*.jpg|PNG|*.png"; openFileDlg.Title = "Open the file"; if (openFileDlg.ShowDialog() == true) { pictureBox.Source = null; m_strOpenFileName = openFileDlg.FileName; pictureBox.Source = CreateImage(m_strOpenFileName); lblSelectFileName.Content = m_strOpenFileName; m_scaleImgProc.Init(); } return; }
private void OnClickBtnFileSelect(object sender, RoutedEventArgs e) { ComOpenFileDialog openFileDlg = new ComOpenFileDialog(); openFileDlg.Filter = "JPG|*.jpg|PNG|*.png"; openFileDlg.Title = "Open the file"; if (openFileDlg.ShowDialog() == true) { pictureBoxOriginal.Source = null; pictureBoxAfter.Source = null; m_strOpenFileName = openFileDlg.FileName; try { LoadImage(); } catch (Exception) { MessageBox.Show(this, "Open File Error", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } pictureBoxOriginal.Source = m_bitmap; btnStart.IsEnabled = true; textBoxTime.Text = ""; if (m_histgram == null) { #if CHART_LIVE_CHART m_histgram = new HistgramLiveCharts(); #elif CHART_OXY_PLOT m_histgram = new HistgramOxyPlot(); #else m_histgram = new HistgramOxyPlot(); #endif } m_histgram.Bitmap = m_bitmap; m_histgram.WBitmap = SelectGetBitmap(m_strCurImgName); if (m_histgram.IsOpen == true) { m_histgram.DrawHistgram(); } } return; }