// Open local capture device private void openLocalFileItem_Click(object sender, System.EventArgs e) { CaptureDeviceForm form = new CaptureDeviceForm( ); if (form.ShowDialog(this) == DialogResult.OK) { // create video source CaptureDevice localSource = new CaptureDevice( ); localSource.VideoSource = form.Device; // open it OpenVideoSource(localSource); } }
public SCTVCameraWindow() { // // Required for Windows Form Designer support // InitializeComponent( ); CaptureDeviceForm form = new CaptureDeviceForm(); //open camera if there is only one if (form.Device != null) { // create video source CaptureDevice localSource = new CaptureDevice(); localSource.VideoSource = form.Device; // open it OpenVideoSource(localSource); } //if (form.Cameras.Count > 0) //{ // string foundDevices = ""; // foreach (Filter camera in form.Cameras) // { // foundDevices += camera.Name + Environment.NewLine; // // create video source // CaptureDevice localSource = new CaptureDevice(); // localSource.VideoSource = camera.MonikerString; // // open it // OpenVideoSource(localSource); // } // //MessageBox.Show("Devices " + foundDevices); //} }