Esempio n. 1
0
        public override void Close()
        {
            try
            {
                IsLink = false;

                // Reset the stopwatch.
                //stopWatch.Reset();
                if (m_Grabber != IntPtr.Zero)
                {
                    MvApi.CameraGrabber_Destroy(m_Grabber);
                }
            }
            catch (Exception ex)
            {
                Util.WriteLog(this.GetType(), ex);
                Util.Notify("相机关闭异常");
            }
        }
        public override void Close()
        {
            try
            {
                IsLink = false;

                // Reset the stopwatch.
                //stopWatch.Reset();
                if (m_Grabber != IntPtr.Zero)
                {
                    MvApi.CameraGrabber_StopLive(m_Grabber);
                    MvApi.CameraGrabber_Destroy(m_Grabber);
                }
                m_Grabber = IntPtr.Zero;
            }
            catch (Exception ex)
            {
                //Util.WriteLog(this.GetType(), ex);
                Util.Notify("相机关闭异常");
                throw ex;  //抛给上层,上层捕获到该异常,不会执行其函数余下的代码;
            }
        }
Esempio n. 3
0
 private void CalForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     MvApi.CameraGrabber_Destroy(m_Grabber);
 }