Exemplo n.º 1
0
        static void Main6(string[] args)
        {
            _virtualCam = new VirtualCamera();
            _virtualCam.Start();
            var calib  = new SimpleAForgeCalibrator(_virtualCam, _virtualCam);
            var pt     = new AForgePenTracker(new RedLaserStrategy(), _virtualCam);
            var parser = new DataParser(calib, pt, typeof(CornerBarycentricMapper));

            parser.Start();
            parser.PenPositionChanged += NewPoint;
            while (true)
            {
                Thread.Sleep(10000);
                //_virtualCam.Clear();
                _virtualCam.AddRect(500, 500, 15, 15, Color.Red);
                _virtualCam.AddRect(530, 530, 15, 15, Color.Black);
                _virtualCam.Draw();
                Thread.Sleep(30);
                //_virtualCam.Clear();
                _virtualCam.AddRect(500, 500, 15, 15, Color.Black);
                _virtualCam.AddRect(530, 530, 15, 15, Color.Red);
                _virtualCam.Draw();
                Debug.WriteLine("Drew Point");
            }
            Console.Read();
        }
Exemplo n.º 2
0
        static void Main4(string[] args)
        {
            _virtualCam = new VirtualCamera();
            _virtualCam.Start();
            var parser = new DataParser(_virtualCam, _virtualCam);

            parser.Start();
            parser.PenPositionChanged += NewPoint;
            while (true)
            {
                Thread.Sleep(10000);
                //_virtualCam.Clear();
                _virtualCam.AddRect(500, 500, 25, 25, Color.Red);
                _virtualCam.AddRect(530, 530, 25, 25, Color.Black);
                _virtualCam.Draw();
                Thread.Sleep(30);
                //_virtualCam.Clear();
                _virtualCam.AddRect(500, 500, 25, 25, Color.Black);
                _virtualCam.AddRect(530, 530, 25, 25, Color.Red);
                _virtualCam.Draw();
                Debug.WriteLine("Drew Point");
            }
            Console.Read();
        }