当前位置: 首页>>代码示例>>C#>>正文


C# TouchEventArgs.GetTouchPoint方法代码示例

本文整理汇总了C#中System.Windows.Input.TouchEventArgs.GetTouchPoint方法的典型用法代码示例。如果您正苦于以下问题:C# TouchEventArgs.GetTouchPoint方法的具体用法?C# TouchEventArgs.GetTouchPoint怎么用?C# TouchEventArgs.GetTouchPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Input.TouchEventArgs的用法示例。


在下文中一共展示了TouchEventArgs.GetTouchPoint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Button_PreviewTouchDown

        private void Button_PreviewTouchDown(object sender, TouchEventArgs e)
        {
            if (touch1 == null)
            {
                touch1 = e.GetTouchPoint(sender as SurfaceButton);
            }
            else
            {
                touch2 = e.GetTouchPoint(sender as SurfaceButton);

                initialDist = touchDist(touch1, touch2);
            }
        }
开发者ID:jcgharvey,项目名称:se306p2,代码行数:13,代码来源:HomeScreen.xaml.cs

示例2: HandleTouch

 private void HandleTouch(TouchEventArgs e)
 {
     var visual = GetTouchVisual(e.TouchDevice.Id);
     var point = e.GetTouchPoint(this.fingerCanvas).Position;
     visual.SetValue(Canvas.LeftProperty, point.X);
     visual.SetValue(Canvas.TopProperty, point.Y);
 }
开发者ID:an83,项目名称:KinectTouch2,代码行数:7,代码来源:ManipulationWindow.xaml.cs

示例3: OnTouchMove

        private void OnTouchMove(object sender, TouchEventArgs e)
        {
            if (!_AlreadySwiped)
            {

                var touch = e.GetTouchPoint(_ParentControl);

                //right now a swipe is 200 pixels

                //Swipe Left
                if (_TouchStart != null && touch.Position.X > (_TouchStart.Position.X + 200))
                {
                    if (OnSwipeLeft != null)
                        OnSwipeLeft(sender, e);
                    _AlreadySwiped = true;
                    StartTimer();
                }

                //Swipe Right
                if (_TouchStart != null && touch.Position.X < (_TouchStart.Position.X - 200))
                {
                    if (OnSwipeRight != null)
                        OnSwipeRight(sender, e);
                    _AlreadySwiped = true;
                    StartTimer();
                }
            }
            //e.Handled = true;
        }
开发者ID:aert,项目名称:aert-csharp-extensions,代码行数:29,代码来源:SwipeHelper.cs

示例4: RecordTouchDown

 private void RecordTouchDown(object sender, TouchEventArgs e)
 {
     _touchPoints++;
     _recordRotation = true;
     System.Windows.Input.TouchPoint touchPoint = e.GetTouchPoint(this);
     System.Windows.Point point = touchPoint.Position;
     _recordY = point.Y;
     if (_touchPoints == 2)
     {
         if (!_isPlaying)
         {
             channel.PlaySample();
             _isPlaying = true;
         }
         else
         {
             channel.StopSample();
             _isPlaying = false;
         }
         _twoTouchLock = true;
     }
     if (_touchPoints == 1)
     {
         if (channel.IsPlaying())
             channel.Pause();
     }
 }
开发者ID:GunioRobot,项目名称:Project-Volcano,代码行数:27,代码来源:DeckControl.cs

示例5: LessonContainer_TouchDown

        private async void LessonContainer_TouchDown(object sender, TouchEventArgs e)
        {
            // Forward touch events to container
            //FrameworkElement control = sender as FrameworkElement;
            //control.CaptureTouch(e.TouchDevice);
            if (LayerStackDC.CurrentState.FingerInkingEnabled)
            {
                LessonContainer.IsContentManipulationEnabled = false;
                return;
            }

            // Saves current touch information
            //touchDevices.Add(e.TouchDevice);
            touchOrigin = e.GetTouchPoint(LessonContainer).Position;

            // Disable manipulation/drawing
            //LessonContainer.IsContentManipulationEnabled = false;
            LayerStackDC.ContainerTouchDown();

            // If touch-and-hold (within 10px radius circle, over 500ms)
            if (await TouchHelper.TouchHold(e, LessonContainer, 500, 10))
            {
                // Opens RadialMenu
                LessonContainer.IsContentManipulationEnabled = false;
                LayerStackDC.OpenRadialMenu(LayerStackDC.Viewport.GetViewport(),
                    e.GetTouchPoint(LessonContainer).Position, RadialMenuState.Levels.Main);

                // Un-forward touch events to container
                //control.ReleaseAllTouchCaptures();
            }
        }
开发者ID:aragoubi,项目名称:Nine,代码行数:31,代码来源:FreeNotesPage.xaml.cs

示例6: OnTouchDown

        } //

        public void OnTouchDown(object xSender, TouchEventArgs e)
        {
            Canvas lCanvas = xSender as Canvas;
            if (lCanvas == null) return;

            TouchPoint lTouchPoint = e.GetTouchPoint(lCanvas);
            if (lTouchPoint == null) return;

            myTuple lTuple = _PointA;
            if (lTuple != null)
            {
                if (lTuple.Item1 == e.TouchDevice.Id) return; // this was finger 1, not going to happen anyway as it cannot touchdown twice
                Point lPointA = lTuple.Item2;

                // store second finger; we don't care about its ID, so it could also be finger 3, 4 or 5 ...
                Point lPointB = lTouchPoint.Position;
                _PointB = new myTuple(e.TouchDevice.Id, lPointB);
                RedrawRectangle(lPointA, lPointB);
                return;
            }

            // first finger
            DrawNewRectangle(lCanvas, lTouchPoint.Position, lTouchPoint.TouchDevice.Id);
            return;
        } //
开发者ID:huoxudong125,项目名称:HQF.Tutorial.WPF,代码行数:27,代码来源:Zoom.cs

示例7: SurfaceWindow_TouchDown

        private void SurfaceWindow_TouchDown(object sender, TouchEventArgs e)
        {
            //test
            Ellipse handRange = new Ellipse();
            handRange.Fill = System.Windows.Media.Brushes.DeepPink;
            handRange.Width = 100;
            handRange.Height = 100;
            TranslateTransform Pos = new TranslateTransform();
            Pos.X = (int)e.GetTouchPoint(this).Position.X;//-this.Width/2;
            Pos.Y = (int)e.GetTouchPoint(this).Position.Y;//-this.Height/2;
            handRange.RenderTransform = null;
            handRange.RenderTransform = Pos;
            // HandRange.
            DrawingCanvas.Children.Add(handRange);

            //testover


            int X = (int)e.GetTouchPoint(this).Position.X;
            int Y = (int)e.GetTouchPoint(this).Position.Y;
            watchingWindow.getHands((int)this.Width, (int)this.Height);
            Console.Out.WriteLine(watchingWindow.GetUser(X, Y, (int)this.Width, (int)this.Height));
            Dictionary<String, System.Drawing.Point> Hands = watchingWindow.getHands(WindowsWidth, WindowsHeight);
            foreach (KeyValuePair<String, System.Drawing.Point> pair in Hands)
            {
                System.Drawing.Point HandPoint = pair.Value;
                String HandString = pair.Key;
                //Console.Out.WriteLine("Hand in " + HandPoint.X + " , " + HandPoint.Y);
                if (HandPoint.X != 0 && HandPoint.Y != 0)
                    if (HandPoint.X < (int)this.Width && HandPoint.Y < (int)this.Height)
                    {
                        Ellipse HandRange = new Ellipse();
                        HandRange.Fill = System.Windows.Media.Brushes.DarkBlue;
                        HandRange.Width = 100;
                        HandRange.Height = 100;
                        TranslateTransform pos = new TranslateTransform();
                        pos.X = HandPoint.X;//-this.Width/2;
                        pos.Y = HandPoint.Y;// -this.Height / 2;
                        HandRange.RenderTransform = null; 
                        HandRange.RenderTransform = pos;
                        // HandRange.
                        
                        DrawingCanvas.Children.Add(HandRange);
                        Console.Out.WriteLine(HandString+" in " + HandPoint.X + " , " + HandPoint.Y);
                    }
            }
        }
开发者ID:guozanhua,项目名称:KinectTouchFrame,代码行数:47,代码来源:SurfaceWindow1.xaml.cs

示例8: layoutRoot_TouchDown

        public void layoutRoot_TouchDown(object sender, TouchEventArgs e)
        {
            TouchPoint p = e.GetTouchPoint(GestureFramework.LayoutRoot);
            TouchInfo info = p.ToTouchInfo();
            UIElement source = e.OriginalSource as UIElement;

            base.AddNewTouchPoint(info, source);
        }
开发者ID:tuliosouza,项目名称:ASG,代码行数:8,代码来源:Windows7TouchInputProvider.cs

示例9: OnPreviewTouchDown

        protected override void OnPreviewTouchDown(TouchEventArgs e)
        {
            //오브젝트 선택
            TouchPoint pt = e.GetTouchPoint(this);
            this.HitTestHelper.SelectItemAt(pt.Position);

            base.OnPreviewTouchDown(e);
        }
开发者ID:habs57,项目名称:tablet-interaction,代码行数:8,代码来源:SlideListBox.cs

示例10: Slider_TouchDown

        private void Slider_TouchDown(object sender, TouchEventArgs e)
        {
            VisualStateManager.GoToState((FrameworkElement)sender, "Pressed", true);

            var slider = (Slider)sender;
            slider.SetPositionByControlPoint(e.GetTouchPoint(slider).Position);
            slider.CaptureTouch(e.TouchDevice);
            e.Handled = true;
        }
开发者ID:RemiGC,项目名称:EarTrumpet,代码行数:9,代码来源:MainWindow.xaml.cs

示例11: canvas_TouchMove

        private void canvas_TouchMove(object sender, TouchEventArgs e)
        {
            // Get the ellipse that corresponds to the current touch-down.
            Ellipse ellipse = movingEllipses[e.TouchDevice.Id];

            // Move it to the new touch-down point.
            TouchPoint touchPoint = e.GetTouchPoint(canvas);
            Canvas.SetTop(ellipse, touchPoint.Bounds.Top);
            Canvas.SetLeft(ellipse, touchPoint.Bounds.Left);
        }
开发者ID:ittray,项目名称:LocalDemo,代码行数:10,代码来源:RawTouch.xaml.cs

示例12: OnTouchUp

 protected override void OnTouchUp(TouchEventArgs e)
 {
     TouchPoint point = e.GetTouchPoint(card.CardControler.MainWindow.CardLayer);
     card.CardControler.MainWindow.TouchControler.TouchUp(e.TouchDevice, point);
     card.CardControler.MainWindow.ControlWindow.UpdateTextInfo(card.CardControler.MainWindow.TouchControler.ToString(), 1);
     Matrix mtx = (this.RenderTransform as MatrixTransform).Matrix;
     mtx.ScaleAt(1.0 / 1.5, 1.0 / 1.5, this.Width / 2, -STATICS.DEAULT_CARD_SIZE.Height + this.Height / 2);
     this.RenderTransform = new MatrixTransform(mtx);
     e.Handled = true;
     base.OnTouchUp(e);
 }
开发者ID:nius1989,项目名称:CardDesign_TechSnack,代码行数:11,代码来源:Linking_Icon.xaml.cs

示例13: OnTouchMove

 protected override void OnTouchMove(TouchEventArgs e)
 {
     TouchPoint point = e.GetTouchPoint(card.CardControler.MainWindow.CardLayer);
     card.CardControler.MainWindow.TouchControler.TouchMove(this, this.GetType(), e.TouchDevice, point);
     if (STATICS.DEBUG_MODE)
     {
         card.CardControler.MainWindow.ControlWindow.UpdateTextInfo(card.CardControler.MainWindow.TouchControler.ToString(), 1);
     }
     e.Handled = true;
     base.OnTouchMove(e);
 }
开发者ID:nius1989,项目名称:CardDesign_TechSnack,代码行数:11,代码来源:Linking_Icon.xaml.cs

示例14: IsDoubleTap

        public bool IsDoubleTap(TouchEventArgs e)
        {
            Point currentTapPosition = e.GetTouchPoint(_ParentControl).Position;
            bool tapsAreCloseInDistance = GetDistanceBetweenPoints(currentTapPosition, _LastTapLocation) < 40;
            _LastTapLocation = currentTapPosition;

            TimeSpan elapsed = _DoubleTapStopwatch.Elapsed;
            _DoubleTapStopwatch.Restart();
            bool tapsAreCloseInTime = (elapsed != TimeSpan.Zero && elapsed < TimeSpan.FromSeconds(0.7));

            return tapsAreCloseInDistance && tapsAreCloseInTime;
        }
开发者ID:aert,项目名称:aert-csharp-extensions,代码行数:12,代码来源:DoubleTapHelper.cs

示例15: OnTouchDown

 protected override void OnTouchDown(TouchEventArgs e)
 {
     this.CaptureTouch(e.TouchDevice);
     TouchPoint point = e.GetTouchPoint(card.CardControler.MainWindow.CardLayer);
     card.CardControler.MainWindow.TouchControler.TouchDown(this, this.GetType(), e.TouchDevice.Id, point);
     Matrix mtx = (this.RenderTransform as MatrixTransform).Matrix;
     mtx.ScaleAt(1.5, 1.5, this.Width / 2, this.Height / 2);
     this.RenderTransform = new MatrixTransform(mtx);
     card.CardControler.MainWindow.ControlWindow.UpdateTextInfo(card.CardControler.MainWindow.TouchControler.ToString(), 1);
     e.Handled = true;
     base.OnTouchMove(e);
 }
开发者ID:nius1989,项目名称:CardDesign_TechSnack,代码行数:12,代码来源:Copy_Icon.xaml.cs


注:本文中的System.Windows.Input.TouchEventArgs.GetTouchPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。