Exemple #1
0
        private void CameraFormLoad(object sender, EventArgs e)
        {
            webcam = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            if (webcam.Count == 0)
            {
                MessageBox.Show(NoDeviceMessage);
                Application.Exit();
                return;
            }

            cam = new VideoCaptureDevice(webcam[0].MonikerString);
            cam.VideoResolution = cam.VideoCapabilities[cameraViewModel.getHighestResoliutionIndex(cam)];
            cam.NewFrame       += new NewFrameEventHandler(cam_newFrame);
            cam.Start();
        }