Beispiel #1
0
        public void fnConectarWebCam(string panel)
        {
            _FilterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            _Webcam = new OWebcam();
            _XLocation_pnlWebCam = 0;
            _YLocation_pnlWebCam = 0;
            var picture = new PictureBox
            {
                Name     = "canal" + _Camaras.ToString(),
                Size     = new Size(520, 320),
                Location = new Point(_XLocation_pnlWebCam, _YLocation_pnlWebCam),
            };

            if (panel.Equals("ENTREVISTADOR"))
            {
                if (panel_webcam.Controls.Count > 0)
                {
                    panel_webcam.Controls.RemoveAt(0);
                }
                panel_webcam.Controls.Add(picture);
            }
            else
            {
                panel_camaraExt.Controls.Add(picture);
            }

            _Webcam.Image            = picture;
            _Webcam.Device           = new VideoCaptureDevice(_FilterInfoCollection[0].MonikerString);
            _Webcam.Device.NewFrame += VideoCaptureDevice_NewFrame;
            _Webcam.Device.Start();
        }
Beispiel #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     comboBoxDispositivos.DataSource    = _Devices;                                     //Se le asigna la lista con los dispositivos conectados al comobobox de dispositivos
     comboBoxDispositivos.DisplayMember = "Nombre";
     _FilterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice); //Se agregan las webcam disponibles al combobox de webcam
     foreach (FilterInfo filterInfo in _FilterInfoCollection)
     {
         comboBoxWebCam.Items.Add(filterInfo.Name);
     }
     comboBoxWebCam.SelectedIndex = 0;
     _Webcam = new OWebcam();
 }