private void SettingsButton_Click(object sender, EventArgs e) { if (videoDevice != null) { videoDevice.DisplayPropertyPage(IntPtr.Zero); } }
private void bSettings_Click(object sender, EventArgs e) { if (videoSource.IsRunning) { videoSource.DisplayPropertyPage(Handle); } }
public void DisplayPropertyPage() { if (_VideoCaptureDevice != null) { _VideoCaptureDevice.DisplayPropertyPage(IntPtr.Zero); } }
private void PropertiesButtonClick(object sender, EventArgs e) { if (_videoSource != null) { _videoSource.DisplayPropertyPage(Handle); } }
private void bttnCamProp_Click(object sender, EventArgs e) { VideoCaptureDevice localSource = new VideoCaptureDevice(selectedWebcam); //localSource.DisplayPropertyPage(this.Handle); // modal dialog localSource.DisplayPropertyPage(IntPtr.Zero); // non-modal }
private void lblAudioDeviceSettings_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (SelectedAudioDevice != null) { SelectedAudioDevice.DisplayPropertyPage(this.Handle); // IntPtr.Zero } }
private void bttnCamProp_Click(object sender, EventArgs e) { //hjfgjgf if (CameraRig.ConnectedCameras[CameraRig.ConfigCam].cam.isIPCamera) { try { IPAddress parsedIPAddress; Uri parsedUri; string name = CameraRig.ConnectedCameras[CameraRig.ConfigCam].cam.name; //check that the url resolves if (Uri.TryCreate(name, UriKind.Absolute, out parsedUri) && IPAddress.TryParse(parsedUri.DnsSafeHost, out parsedIPAddress)) { bubble.openInternetBrowserAt("http:\\" + parsedIPAddress.ToString()); } } catch (Exception) { bubble.logAddLine("Unable to connect webcam index site."); } } else { VideoCaptureDevice localSource = new VideoCaptureDevice(selectedWebcam); localSource.DisplayPropertyPage(IntPtr.Zero); // non-modal } }
private void Source1_Properties_Button_Click(object sender, EventArgs e) { if (videoSource != null) { videoSource.DisplayPropertyPage(this.Handle); } }
public bool DisplayPropertyWindow(IntPtr handle) { try { _captureDevice.DisplayPropertyPage(handle); } catch { return(false); } return(true); }
// Some good info to make this more robust // http://haryoktav.wordpress.com/2009/03/21/webcam-in-c-aforgenet/ // private void button1_Click(object sender, EventArgs e) { CustomerWebcam = new VideoCaptureDevice(VideoCaptureDevices[comboBox1.SelectedIndex].MonikerString); CustomerWebcam.NewFrame += new NewFrameEventHandler(CustomerWebcam_NewFrame); int indexMin = -1; int MinPixels = 0; int indexMax = -1; int MaxPixels = 0; for (int i = 0; i < CustomerWebcam.VideoCapabilities.Length; i++) { int pixels = CustomerWebcam.VideoCapabilities[i].FrameSize.Height * CustomerWebcam.VideoCapabilities[i].FrameSize.Width; if (indexMin == -1) { indexMin = i; MinPixels = pixels; } if (indexMax == -1) { indexMax = i; MaxPixels = pixels; } if (pixels < MinPixels) { indexMin = i; MinPixels = pixels; } if (pixels > MaxPixels) { indexMax = i; MaxPixels = pixels; } } CustomerWebcam_CapabilitiesIndexMin = indexMin; CustomerWebcam_CapabilitiesIndexMax = indexMax; CustomerWebcam.VideoResolution = CustomerWebcam.VideoCapabilities[indexMin]; CustomerWebcam.DisplayPropertyPage(IntPtr.Zero); CustomerWebcam.Start(); }
private void invokeCameraControlToolStripMenuItem_Click(object sender, EventArgs e) { if (videoSource1 == null) { return; } videoSource1.DisplayPropertyPage(this.Parent.Handle); }
private void startButton_Click(object sender, RoutedEventArgs e) { VideoDevice = new VideoCaptureDevice(VideoCaptureDevices[sourcesComboBox.SelectedIndex].MonikerString); VideoDevice.NewFrame += VideoDevice_NewFrame; VideoDevice.Start(); VideoDevice.DisplayPropertyPage(IntPtr.Zero); }
private void buttonWebCamSettings_Click(object sender, RoutedEventArgs e) { try { IntPtr hwnd = new WindowInteropHelper(this).Handle; captureDevice.DisplayPropertyPage(hwnd); } catch { } }
public static void show_Controls() { VideoCaptureDevice Cam1; FilterInfoCollection VideoCaptureDevices; VideoCaptureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); Cam1 = new VideoCaptureDevice(VideoCaptureDevices[0].MonikerString); Cam1.DisplayPropertyPage(IntPtr.Zero); //This will display a form with camera controls }
private void Property_button(object sender, EventArgs e) { if (pictureBox1.Image != null) // since image = object { FinalFrame.DisplayPropertyPage(IntPtr.Zero); //This will display a form with camera controls } else { MessageBox.Show("Properties are not available", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);; } }
private void btnDeviceProperties_Click(object sender, EventArgs e) { try { device.DisplayPropertyPage(this.Handle); } catch (Exception) { log.ErrorFormat(CameraLang.FormConfiguration_DevicePropertyPages_Error, summary.Alias); } }
private void button4_Click(object sender, EventArgs e) { try { videoSource.DisplayPropertyPage(this.Handle); } catch { MessageBox.Show("Включите Web-Камеру"); } }
/// <summary> /// The Cameraparameters. /// </summary> private void Cameraparameters() { if (!(videoSource == null)) { if (videoSource.IsRunning) { videoSource.DisplayPropertyPage(IntPtr.Zero); //var x = videoSource.VideoCapabilities; //var y = videoSource.VideoResolution; } } }
private void butAdvice_Click(object sender, EventArgs e) { try { VideoCaptureDevice camAdvice = new VideoCaptureDevice(_filterInfoCollection[cbxDevName.SelectedIndex].MonikerString); camAdvice.DisplayPropertyPage(this.Handle); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void AdvanceSetting() { if (null == this.SelectedCamera) { return; } this.SelectedCamera.SignalToStop(); this.SelectedCamera.WaitForStop(); this.SelectedCamera.Stop(); SelectedCamera.DisplayPropertyPage(this.WindowHandle); SelectedCamera.Start(); }
public void DisplayDevicePropertyPage(IntPtr _windowHandle) { VideoCaptureDevice device = m_VideoSource as VideoCaptureDevice; if(device != null) { try { device.DisplayPropertyPage(_windowHandle); } catch(Exception) { log.ErrorFormat("Error when trying to display device property page."); } } }
/// <summary> /// 设置摄像头参数 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CameraSetting_Click(object sender, RoutedEventArgs e) { FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); var cameraIndex = XCameraList.SelectedIndex; if (videoDevices.Count > 0) { var camera = new VideoCaptureDevice(videoDevices[cameraIndex].MonikerString); IntPtr hwnd = new WindowInteropHelper(this).Handle; camera.DisplayPropertyPage(hwnd); } else { MessageBox.Show("读取摄像头出错,未找到有效的摄像头!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); } }
private void Form1_Load(object sender, EventArgs e) { FilterInfoCollection fic = new FilterInfoCollection(FilterCategory.VideoInputDevice); videoDevice = new VideoCaptureDevice(fic[0].MonikerString); videoDevice.DisplayPropertyPage(IntPtr.Zero); videoDevice.NewFrame += VideoDevice_NewFrame; videoDevice.Start(); baiduAi = FaceAi.GetInstance(); voiceAi = VoiceAi.GetInstance(); Thread mythread = new Thread(ThreadMain); mythread.Start(); string voiceFilePath = voiceAi.Tts("百度AI"); voiceAi.Play(voiceFilePath); }
public void ShowProperties() { videoSource.DisplayPropertyPage(IntPtr.Zero); }
private void button_cam_config_Click(object sender, EventArgs e) { videoSource.DisplayPropertyPage(IntPtr.Zero); }
public void ShowCameraSettings(IntPtr parentWindow) { _videoDevice?.DisplayPropertyPage(parentWindow); }
private void WebCamOptionButton_Click(object sender, RoutedEventArgs e) { LocalWebCam.DisplayPropertyPage(IntPtr.Zero); }
private void foo() { Cam1.DisplayPropertyPage(IntPtr.Zero); //This will display a form with camera controls }
public void CameraSettings() { camera.DisplayPropertyPage(IntPtr.Zero); }
private void Button_Click(object sender, RoutedEventArgs e) { CloseOptions(); videoSource.DisplayPropertyPage(new WindowInteropHelper(this).Handle); }