設備的開啟與操作: 開啟設備

本例介紹的是如何在IC Imaging Control中開啟一台設備,並將其傳來的實時畫面顯示出來。
語言:.NET C#/Visual Basic
版本:3.0.3
发布于:2005年4月7日
作者:IC Imaging Control 技術支持部
需求:IC Imaging Control >2.1
由WDM數據流類驅動程序驅動的相機、視頻轉換器或圖像採集卡

程序窗體如圖所示:

The dialog window of the sample application.

程序首先在 listBox1 裡列出系統中所有視頻捕捉設備的名稱。 把listBox1.DataSource 屬性設為 IcImagingControl.Devices,所有視頻捕捉設備的名稱都可以被列於listBox1中。

[C#]
private void Form1_Load(object sender, System.EventArgs e)
{
    listBox1.DataSource = icImagingControl1.Devices;
}

當用戶點擊"Open Device"按鈕後,程序停止視頻數據流 (.LiveStop), 而後通過listBox1.SelectedItem獲得所選設備, 而後顯示現場圖像(.LiveStart):

[C#]
private void buttonOpen_Click(object sender, System.EventArgs e)
{
    TIS.Imaging.Device dev = listBox1.SelectedItem as TIS.Imaging.Device;

    if( dev != null )
    {
        icImagingControl1.LiveStop();
                icImagingControl1.Device = dev;
        icImagingControl1.LiveStart();
    }
}

private void buttonClose_Click(object sender, System.EventArgs e)
{
    Close();
}

相關源代碼示例

責任聲明
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.