ICImagingControl.MemorySaveImage Method

現在のバッファをbmpファイルとして保存します。

構文

[VB.NET]
Public Sub MemorySaveImage(Filename As String) 
[C#]
public void MemorySaveImage(string Filename); 
名  前 説  明
filename 保存する画像ファイルの名前をつけます。

サンプル

この例ではコモンダイアログを開き、そこから選択したファイル名で画像を保存する方法を紹介しています。

[VB.NET]
Try
     '  ライブ表 示中であれば画像を取得。そうでない場合はすでに存在する画像を使用。
    If IcImagingControl1.LiveVideoRunning Then
         IcImagingControl1.MemorySnapImage()
     End If

     '  コモンダイアログを開き、ファイル名の選択、そして画像の保存をできるようにする。
    Dim dialog As New System.Windows.Forms.SaveFileDialog
    dialog.Filter = "Bitmap (*.bmp)|*.bmp"

     If dialog.ShowDialog() = DialogResult.OK Then
         IcImagingControl1.MemorySaveImage(dialog.FileName)
     End If
Catch ex As System.Exception
     MsgBox(ErrDescription)
End Try
[C#]
try
{
     //  ライブ 表示中であれば画像を取得。そうでない場合はすでに存在する画像を使用。
     if (ICImagingControl1.LiveVideoRunning)
     {
         ICImagingControl1.MemorySnapImage();
     }

     //  コモン ダイアログを開き、ファイル名の選択、そして画像の保存をできるようにする。
    System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog();
     dialog.Filter = "Bitmap (*.bmp)|*.bmp";

     if (dialog.ShowDialog() == DialogResult.OK)
     { 
         ICImagingControl1.MemorySaveImage(dialog.FileName);
     }
}
catch (Exception ex)
{
     MessageBox.Show(ex.Message);
}