public void StopVideo() { try { if (managedCamera != null) { // End acquisition managedCamera.EndAcquisition(); managedCamera.UnregisterEvent(imageEventListener); //clear queue PtGreyCameraImage item; while (imageQueue.TryDequeue(out item)) { // do nothing } _videoMode = false; } } catch (SpinnakerException ex) { Debug.WriteLine("Error: {0}", ex.Message); } }
public override void DisConnect() { try { if (camera != null) { StopCapture(); camera.UnregisterEvent(imageEventListener); camera.DeInit(); } } catch (Exception ex) { Debug.WriteLine("PtGrey Disconnect : " + ex.Message); } }