图像获取: 保存图象序列

讲解如何使用IC Imaging Control从图象数据流中以BMP格式保存图象序列(按顺序编号)。
语言:.NET C#/Visual Basic
版本:3.0.3
发布于:2005年4月7日
作者:IC Imaging Control 技术支持部
系统要求:IC Imaging Control >2.1
由WDM数据流类驱动程序驱动的相机、视频转换器或图像采集卡

示例程序窗体如图所示:

The Testdialog of IC Imaging Control,

程序允许把图象序列写到硬盘上:

程序开始运行后首先掉用内置对话框用于选择一台设备(.ShowDeviceSettingsDialog). 而后通过.LiveStart显示设备传来的现场画面:

[C#]
private void Form1_Load(object sender, System.EventArgs e)
{
    icImagingControl1.ShowDeviceSettingsDialog();

    if( icImagingControl1.DeviceValid )
    {
        icImagingControl1.LiveStart();
    }
    else
    {
        Close();
    }
}

当用户点击"Save Next Image",.MemorySnapImage从图象数据流中抓取一帧图像, 将其写入内部环形缓存。.MemorySaveImage 将其保存为一个 BMP 文件:

[C#]
private void btnSaveNextImage_Click(object sender, System.EventArgs e)
{
    icImagingControl1.MemorySnapImage();

    string fileName = "Image " + imageNumber + ".bmp";
    icImagingControl1.MemorySaveImage( fileName );

    imageNumber += 1;
}

相关源代码示例

责任声明
IC Imaging Control 源代码库中的所有代码均只用于教学目的,The Imaging Source Europe GmbH 作为IC Imaging Control的开发制造商,不对任何由于使用本文或其中源代码所产生的后果承担责任。

该网站为The Imaging Source网络的一部分。其它的站点包括 公司, Imaging, 天文相机, Astronomy Cameras Blog, Blog caméras d'astronomie, 天文相机有奖竞答, TX Text Control, LiveDocx, phpLiveDocxForum.