Exemplo n.º 1
0
        private void Main_Load(object sender, EventArgs e)
        {
            webcamView.SizeMode = Properties.Settings.Default.zoomMode;

            webcam = new Webcam();
            recording = new Recording(webcam);

            webcam.DeviceMoniker = Properties.Settings.Default.cameraDevice;

            if (Properties.Settings.Default.cameraResolution != null)
            {
                webcam.CameraResolution = new Resolution(Properties.Settings.Default.cameraResolution);
            }

            webcam.Init();
            webcam.Start();

            recording.Init();
            recording.FrameRate = 30;

            if (Properties.Settings.Default.enableWebServer)
            {
                WebMonitor.Init();

                WebMonitor.Webcam = webcam;
                WebMonitor.Username = Properties.Settings.Default.webUsername;
                WebMonitor.Password = Properties.Settings.Default.webPassword;

                Thread webMonitorServerThread = new Thread(WebMonitor.Start);
                webMonitorServerThread.Start();
            }

            webcam.FrameUpdate += FrameUpdateHandler;
            webcam.WebcamInit += WebcamInitHandler;

            UpdateUi(null, null);

            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
            timer.Interval = 1000;
            timer.Tick += UpdateUi;
            timer.Start();
        }
Exemplo n.º 2
0
 public Recording(Webcam webcam)
 {
     Webcam = webcam;
 }