示例#1
0
 public DebugWindow()
 {
     InitializeComponent();
     _teensy = new Teensy("COM3");
     logic = new Logic(_teensy);
     ReloadTracks();
     RefreshPictureBoxes();
 }
示例#2
0
文件: Form1.cs 项目: doskir/Drumbot
 public Form1()
 {
     InitializeComponent();
     _teensy = new Teensy("COM3");
     _logic = new Logic(_teensy);
     captureThread = new Thread(new ParameterizedThreadStart(cv.StartCapturing));
     captureThread.Name = "captureThread";
     captureThread.Start(_logic);
     liveViewTimer = new Timer();
     liveViewTimer.Interval = 20;
     liveViewTimer.Tick += new EventHandler(liveViewTimer_Tick);
     liveViewTimer.Start();
 }
示例#3
0
 public ReplayWindow()
 {
     InitializeComponent();
     _fakeOutput = new FakeOutput();
     logic = new Logic(_fakeOutput);
 }
示例#4
0
        public void StartCapturing(object logic)
        {
            _logic = (Logic)logic;
            int fps = 25;

            writerThread = new Thread(ImageWriter);
            writerThread.Name = "writerThread";
            writerThread.Start();

            var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            _captureDevice = new VideoCaptureDevice(videoDevices[0].MonikerString);
            _captureDevice.DesiredFrameSize = new Size(704, 576);
            _captureDevice.DesiredFrameRate = fps;
            _captureDevice.NewFrame += new AForge.Video.NewFrameEventHandler(camera_NewFrame);
            _captureDevice.Start();
            globFrameCount = 0;
            globCaptureStart = DateTime.Now;
            //now capturing
        }