public VideoCaptureDeviceForm()
{
InitializeComponent();
ConfigureSnapshots = false;
// show device list
try
{
// enumerate video devices
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
if (videoDevices.Count == 0)
throw new ApplicationException();
// add all devices to combo
foreach (FilterInfo device in videoDevices)
{
devicesCombo.Items.Add(device.Name);
}
}
catch (ApplicationException)
{
devicesCombo.Items.Add("No local capture devices");
devicesCombo.Enabled = false;
okButton.Enabled = false;
}
}