Exemplo n.º 1
0
 private void Close_Devices()
 {
     Show.SignalToStop();
     Show.WaitForStop();
     videoSource = null;
     videoDevices.Clear();
     Get_All_Devices();
 }
 private void VKApp_FormClosing(object sender, FormClosingEventArgs e)
 {
     videoSourcePlayer.SignalToStop();
     videoSourcePlayer.WaitForStop();
     videoSourcePlayer.Dispose();
     videoDevices.Clear();
     videoDevices = null;
     videoDevices = null;
 }
 private void AForgeCamera_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (captureDevice != null)
     {
         captureDevice.Stop();
     }
     CaptureDevices.Clear();
     AVPlayer_Cam1.VideoSource = null;
     AVPlayer_Cam1.Stop();
 }
Exemplo n.º 4
0
 static public void Attendance_ControlRemoved()
 {
     try
     {
         if (finalframe.IsRunning == true)
         {
             finalframe.Stop();
             capturedevice.Clear();
         }
     }
     catch (Exception ex) { }
 }
Exemplo n.º 5
0
 public static void CloseVideoSource()
 {
     if (!(videoSource == null))
     {
         if (videoSource.IsRunning)
         {
             videoSource.SignalToStop();
             videoSource = null;
         }
     }
     videoDevices.Clear();
 }
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBox.Show("是否退出软件?", "询问", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         try
         {
             if (captureDevice != null)
             {
                 captureDevice.Stop();
             }
             CaptureDevices.Clear();
             videoSourcePlayer.VideoSource = null;
             videoSourcePlayer.Stop();
         }
         catch (Exception) { }
         Process.GetCurrentProcess().Kill();
         Application.Exit();
     }
     else
     {
         e.Cancel = true;
     }
 }