Пример #1
0
 private void butClose_Click(object sender, EventArgs e)
 {
     //停止连续采集
     MVGigE.MVStopGrab(m_hCam);
     //关闭相机
     MVGigE.MVCloseCam(m_hCam);
     this.butOpen.Enabled  = true;
     this.butGrab.Enabled  = false;
     this.butClose.Enabled = false;
     m_bRun = false;
 }
Пример #2
0
 private void MV_E_EM_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (m_bRun)
     {
         //停止采集
         MVGigE.MVStopGrab(m_hCam);
     }
     if (!this.butOpen.Enabled)
     {
         //关闭相机
         MVGigE.MVCloseCam(m_hCam);
     }
     //释放相机资源
     MVGigE.MVTerminateLib();
 }