private void comboResolution_DropDown(object sender, EventArgs e) { comboResolution.BeginUpdate(); comboResolution.Items.Clear(); if (videoSource.SelectedItem != null) { VideoSourceInfo webcam = videoSource.SelectedItem as VideoSourceInfo; if (webcam != null) { VideoCaptureDevice vs = new VideoCaptureDevice(webcam.Moniker); foreach (VideoCapabilities cap in vs.VideoCapabilities) { comboResolution.Items.Add(new CapInfo(cap.FrameSize.Width, cap.FrameSize.Height, cap.MaxFrameRate)); } } } comboResolution.EndUpdate(); }
private void buttonSettings_Click(object sender, EventArgs e) { string extDescription = "\n"; VideoSourceInfo camInfo = videoSource.SelectedItem as VideoSourceInfo; if (camInfo != null && !string.IsNullOrEmpty(camInfo.Name)) { try { Program.mainform.videoManager.ShowPpropertiesDialog(camInfo.Moniker, this); return; } catch (WebcamPropertiesException err) { extDescription += err.Message; } } Reporter.SeriousError("Can't get webcam moniker to display properties.\nBe sure your Webcam connected." + extDescription); }