private void RecordButton_Click(object sender, RoutedEventArgs e) { if (Directory.Exists(MainWindow.MWInstance.videoDir)) { WebCamCtrl.VideoDirectory = MainWindow.MWInstance.videoDir; WebCamCtrl.StartRecording(); } }
private void SnapshotButton_Click(object sender, RoutedEventArgs e) { if (Directory.Exists(MainWindow.MWInstance.imageDir)) { WebCamCtrl.ImageDirectory = MainWindow.MWInstance.imageDir; WebCamCtrl.TakeSnapshot(); } }
private void camStartButton_Click(object sender, RoutedEventArgs e) { try { WebCamCtrl.StartCapture(); } catch (Microsoft.Expression.Encoder.SystemErrorException) { MessageBox.Show("Device is in use by another application"); } }
private void StartButton_Click(object sender, RoutedEventArgs e) { try { // Display webcam video on control. WebCamCtrl.FrameSize = new System.Drawing.Size(450, 310); WebCamCtrl.StartCapture(); } catch (Microsoft.Expression.Encoder.SystemErrorException ex) { MessageBox.Show("Device is in use by another application"); } }
public EyeView() { InitializeComponent(); // Bind the Video and Audio device properties of the // Webcam control to the SelectedValue property of // the necessary ComboBox. Binding bndg_1 = new Binding("SelectedValue"); bndg_1.Source = VidDvcsComboBox; WebCamCtrl.SetBinding(Webcam.VideoDeviceProperty, bndg_1); Binding bndg_2 = new Binding("SelectedValue"); bndg_2.Source = AudDvcsComboBox; WebCamCtrl.SetBinding(Webcam.AudioDeviceProperty, bndg_2); // Create directory for saving video files. string vidPath = @"C:\VideoClips"; if (Directory.Exists(vidPath) == false) { Directory.CreateDirectory(vidPath); } // Create directory for saving image files. string imgPath = @"C:\WebcamSnapshots"; if (Directory.Exists(imgPath) == false) { Directory.CreateDirectory(imgPath); } // Set some properties of the Webcam control WebCamCtrl.VideoDirectory = vidPath; WebCamCtrl.VidFormat = VideoFormat.mp4; WebCamCtrl.ImageDirectory = imgPath; WebCamCtrl.PictureFormat = ImageFormat.Jpeg; WebCamCtrl.FrameRate = 30; WebCamCtrl.FrameSize = new System.Drawing.Size(266, 200); // Find a/v devices connected to the machine. FindDevices(); VidDvcsComboBox.SelectedIndex = 0; AudDvcsComboBox.SelectedIndex = 0; }
private void SnapshotButton_Click(object sender, RoutedEventArgs e) { // Take snapshot of webcam image. WebCamCtrl.TakeSnapshot(); }
private void StopRecordButton_Click(object sender, RoutedEventArgs e) { // Stop recording of webcam video to harddisk. WebCamCtrl.StopRecording(); }
private void EndButton_Click(object sender, RoutedEventArgs e) { // Stop the display of webcam video. WebCamCtrl.StopCapture(); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { WebCamCtrl.StopCapture(); MainWindow.MWInstance.camButton.IsEnabled = true; }
private void StopRecordButton_Click(object sender, RoutedEventArgs e) { WebCamCtrl.StopRecording(); }
private void camStopButton_Click(object sender, RoutedEventArgs e) { WebCamCtrl.StopCapture(); }