public bool SaveCsv()
    {
        bool bRst = true;
        ComSaveFileDialog saveDialog = new ComSaveFileDialog();

        saveDialog.Filter   = "CSV|*.csv";
        saveDialog.Title    = "Save the csv file";
        saveDialog.FileName = "default.csv";
        if (saveDialog.ShowDialog() == true)
        {
            String        strDelmiter   = ",";
            StringBuilder stringBuilder = new StringBuilder();
            int[,] nHistgram = m_nHistgram;
            for (int nIdx = 0; nIdx < (m_nHistgram.Length >> 1); nIdx++)
            {
                stringBuilder.Append(nIdx).Append(strDelmiter);
                stringBuilder.Append(nHistgram[(int)ComInfo.PictureType.Original, nIdx]).Append(strDelmiter);
                stringBuilder.Append(nHistgram[(int)ComInfo.PictureType.After, nIdx]).Append(strDelmiter);
                stringBuilder.Append(Environment.NewLine);
            }
            if (!saveDialog.StreamWrite(stringBuilder.ToString()))
            {
                bRst = false;
            }
        }

        return(bRst);
    }
        /// <summary>
        /// イメージの保存ボタンのクリックイベント
        /// </summary>
        /// <param name="sender">オブジェクト</param>
        /// <param name="e">イベントのデータ</param>
        private void OnClickBtnSaveImage(object sender, EventArgs e)
        {
            ComSaveFileDialog saveDialog = new ComSaveFileDialog();

            saveDialog.Filter = "PNG|*.png";
            saveDialog.Title  = "Save the file";
            if (saveDialog.ShowDialog() == true)
            {
                string strFileName = saveDialog.FileName;
                var    bitmap      = m_scaleImgProc.bitmap;
                if (bitmap != null)
                {
                    try
                    {
                        bitmap.Save(strFileName, System.Drawing.Imaging.ImageFormat.Png);
                    }
                    catch (Exception)
                    {
                        MessageBox.Show(this, "Save Image File Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    bitmap.Dispose();
                }
            }

            return;
        }
        /// <summary>
        /// イメージの保存ボタンのクリックイベント
        /// </summary>
        /// <param name="sender">オブジェクト</param>
        /// <param name="e">ルーティングイベントのデータ</param>
        private void OnClickBtnSaveImage(object sender, RoutedEventArgs e)
        {
            ComSaveFileDialog saveDialog = new ComSaveFileDialog();

            saveDialog.Filter = "PNG|*.png";
            saveDialog.Title  = "Save the file";
            if (saveDialog.ShowDialog() == true)
            {
                string strFileName = saveDialog.FileName;
                using (FileStream stream = new FileStream(strFileName, FileMode.Create))
                {
                    PngBitmapEncoder encoder = new PngBitmapEncoder();
                    WriteableBitmap  bitmap  = m_scaleImgProc.bitmap;
                    if (bitmap != null)
                    {
                        try
                        {
                            encoder.Frames.Add(BitmapFrame.Create(bitmap));
                            encoder.Save(stream);
                        }
                        catch (Exception)
                        {
                            MessageBox.Show(this, "Save Image File Error", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                }
            }
        }