示例#1
0
        private void mainWinForm_Load(object sender, EventArgs e)
        {
            TimeSpan timeToSend = TimeSpan.FromSeconds(0.1);

            var webcam = new WebCam(imgVideo);
            ITransporter transporter = new HttpTransport("http://localhost:60915/");

            var capture = new Capture(timeToSend, webcam, transporter);
            capture.Start();

            // due to webcam bug, reboot every minute
            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(TimeSpan.FromMinutes(1));
                Application.Restart();
            });
        }
示例#2
0
 public Capture(TimeSpan timeToCapture, WebCam camera, ITransporter transporter)
 {
     _timeToCapture = timeToCapture;
     _camera = camera;
     _transporter = transporter;
 }