Beispiel #1
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     captureDevice?.Close();
     captureDevice = null;
     playerWindow?.Close();
     testLogger?.Close();
     networkListener?.Close();
 }
Beispiel #2
0
 private void cb_DeviceID_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     selectedDeviceIndex = cb_DeviceID.SelectedIndex;
     captureDevice?.Close();
     if (selectedDeviceType.CompareTo(DeviceTypes[0]) == 0)
     {
         if (selectedDeviceIndex >= 0)
         {
             captureDevice = new ScreenCapturer(selectedDeviceIndex);
             captureDevice.NewFrameAvailableEvent += CaptureDevice_NewFrameAvailableEvent;
             captureDevice.Start();
         }
     }
     else if (selectedDeviceType.CompareTo(DeviceTypes[1]) == 0)
     {
         if (selectedDeviceIndex >= 0)
         {
             captureDevice = new CamRetriever(selectedDeviceIndex, 1280, 720);
             captureDevice.NewFrameAvailableEvent += CaptureDevice_NewFrameAvailableEvent;
             captureDevice.Start();
         }
     }
 }