Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();
            
            //Load pictures from MyPictures
            if (!LoadPictures())
            {
                MessageBox.Show("No Pictures in MyPicture folder");
                Environment.Exit(0);
            }

            //Create the touch handler
            _touchHandler = Factory.CreateHandler<TouchHandler>(this);

            _pictureTrackerManager = new PictureTrackerManager(_canvas, this);

            //Register for touch events
            _touchHandler.TouchDown += _pictureTrackerManager.ProcessDown;
            _touchHandler.TouchUp += _pictureTrackerManager.ProcessUp;
            _touchHandler.TouchMove += _pictureTrackerManager.ProcessMove;

            Paint += (s, e) => { _canvas.Draw(e.Graphics); };
        }
Ejemplo n.º 2
0
            public PictureTracker(PictureTrackerManager pictureTrackerManager, Form form)
            {
                _pictureTrackerManager = pictureTrackerManager;
                _form = form;

                //Start inertia velocity calculations
               _processor.ManipulationStarted += (s, e) =>
               {
                   _inertiaParam.Reset();
               };

                //All completed, inform the tracker manager that the current tracker can be reused
               _processor.ManipulationCompleted += (s, e) => { _inertiaParam.Stop(); pictureTrackerManager.Completed(this); };
               _processor.ManipulationDelta += ProcessManipulationDelta;
               _processor.BeforeInertia += OnBeforeInertia;
            }