當前位置: 首頁>>代碼示例>>C#>>正文


C# PointerRoutedEventArgs.GetIntermediatePoints方法代碼示例

本文整理匯總了C#中Windows.UI.Xaml.Input.PointerRoutedEventArgs.GetIntermediatePoints方法的典型用法代碼示例。如果您正苦於以下問題:C# PointerRoutedEventArgs.GetIntermediatePoints方法的具體用法?C# PointerRoutedEventArgs.GetIntermediatePoints怎麽用?C# PointerRoutedEventArgs.GetIntermediatePoints使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Windows.UI.Xaml.Input.PointerRoutedEventArgs的用法示例。


在下文中一共展示了PointerRoutedEventArgs.GetIntermediatePoints方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DrawingBoard_PointerMoved

 private void DrawingBoard_PointerMoved(object sender, PointerRoutedEventArgs e)
 {
     lock (_renderer)
     {
         _renderer.OnPointerMoved(e.GetIntermediatePoints(DrawingControl));
     }
     DrawingControl.Invalidate();
 }
開發者ID:Dodiese,項目名稱:WIN2DSandBox,代碼行數:8,代碼來源:DrawingBoard.xaml.cs

示例2: OnPointerPressed

 void OnPointerPressed(object sender, PointerRoutedEventArgs e)
 {
     var ps = e.GetIntermediatePoints(null);
     if (ps != null && ps.Count > 0)
     {
         _holdObj = sender;
         gestRec.ProcessDownEvent(ps[0]);
         e.Handled = true;
     }
 }
開發者ID:GregoryMorse,項目名稱:IslamSource,代碼行數:10,代碼來源:MainPage.xaml.cs

示例3: OnPointerReleased

 void OnPointerReleased(object sender, PointerRoutedEventArgs e)
 {
     var ps = e.GetIntermediatePoints(null);
     if (ps != null && ps.Count > 0)
     {
         gestRec.ProcessUpEvent(ps[0]);
         e.Handled = true;
         gestRec.CompleteGesture();
         _holdObj = null;
     }
 }
開發者ID:GregoryMorse,項目名稱:IslamSource,代碼行數:11,代碼來源:MainPage.xaml.cs

示例4: foreach

        private void canvas右邊手寫畫板_PointerMoved(object sender, PointerRoutedEventArgs e)
        {
            if (this.正在手寫中 == false)
            {
                return;
            }

            if (e.Pointer.PointerId == PenID || e.Pointer.PointerId == TouchID)
            {
                foreach (PointerPoint pointerPoint in e.GetIntermediatePoints(this.canvas右邊手寫畫板).Reverse())
                {
                    CurrentContactPoint = pointerPoint.Position;
                    X1 = PreviousContactPoint.X;
                    Y1 = PreviousContactPoint.Y;
                    X2 = CurrentContactPoint.X;
                    Y2 = CurrentContactPoint.Y;

                    if (this.使用中的繪圖工具.手或筆與橡皮擦 == 手或筆與橡皮擦.筆)
                    {
                        手寫物件軌跡_右.手寫物件s.Add(new 手寫物件()
                        {
                            //X1 = LastX,
                            X1 = X1,
                            X2 = X2,
                            //Y1 = LastY,
                            Y1 = Y1,
                            Y2 = Y2,
                        });
                    }
                    else
                    {
                        手寫物件軌跡_右.手寫物件s.Add(new 手寫物件()
                        {
                            X1 = X1,
                            X2 = X2,
                            Y1 = Y1,
                            Y2 = Y2,
                        });
                    }
                    //LastX = CurrentContactPoint.X;
                    //LastY = CurrentContactPoint.Y;

                    PreviousContactPoint = CurrentContactPoint;
                }
                Redraw右邊手寫板();
            }
        }
開發者ID:vulcanlee,項目名稱:Windows8Lab,代碼行數:47,代碼來源:MainPage.xaml.cs

示例5: OnPointerMoved

 void OnPointerMoved(object sender, PointerRoutedEventArgs e)
 {
     _holdObj = sender;
     gestRec.ProcessMoveEvents(e.GetIntermediatePoints(null));
     e.Handled = true;
 }
開發者ID:GregoryMorse,項目名稱:IslamSource,代碼行數:6,代碼來源:MainPage.xaml.cs

示例6: OnPointerMoved

 // Route the pointer moved event to the gesture recognizer.
 // The points are in the reference frame of the canvas that contains the rectangle element.
 void OnPointerMoved(object sender, PointerRoutedEventArgs args)
 {
     // Feed the set of points into the gesture recognizer as a move event
     recognizer.ProcessMoveEvents(args.GetIntermediatePoints(reference));
 }
開發者ID:COMIsLove,項目名稱:Windows-universal-samples,代碼行數:7,代碼來源:5-GestureRecognizer.xaml.cs

示例7: Canvas_PointerMoved

        void Canvas_PointerMoved(object sender, PointerRoutedEventArgs e)
        {
            if (editingRegion == null)
                return;

            // Add points to the edit region.
            regionPoints.AddRange(from point in e.GetIntermediatePoints(canvas)
                                  select ConvertDipsToPixels(point));

            canvas.Invalidate();
            e.Handled = true;
        }
開發者ID:shawnhar,項目名稱:stuart,代碼行數:12,代碼來源:MainPage.xaml.cs

示例8: page_PointerMoved

 static void page_PointerMoved(object sender, PointerRoutedEventArgs e)
 {
     _gr.ProcessMoveEvents(e.GetIntermediatePoints(null));
     e.Handled = true;
     if (OnGestureRaised != null) OnGestureRaised(sender, new CustomGestureArgs() { MovedPointerRoutedEventArgs = e });
 }
開發者ID:liquidboy,項目名稱:X,代碼行數:6,代碼來源:GestureService.cs

示例9: ProcessPointerInput

        // Toggles the color of cells when they are clicked on.
        private void ProcessPointerInput(PointerRoutedEventArgs e)
        {
            if (!isPointerDown)
                return;

            // Invert the display transform, to convert pointer positions into simulation rendertarget space.
            Matrix3x2 transform;
            Matrix3x2.Invert(GetDisplayTransform(canvas), out transform);

            foreach (var point in e.GetIntermediatePoints(canvas))
            {
                if (!point.IsInContact)
                    continue;

                var pos = Vector2.Transform(point.Position.ToVector2(), transform);

                var x = canvas.ConvertDipsToPixels(pos.X, CanvasDpiRounding.Floor);
                var y = canvas.ConvertDipsToPixels(pos.Y, CanvasDpiRounding.Floor);

                // If the point is within the bounds of the rendertarget, and not the same as the last point...
                if (x >= 0 &&
                    y >= 0 &&
                    x < simulationW &&
                    y < simulationH &&
                    ((x != lastPointerX || y != lastPointerY)))
                {
                    // We avoid manipulating GPU resources from inside an input event handler
                    // (since we'd need to handle device lost and possible concurrent running with CreateResources).
                    // Instead, we collect up a list of points and process them from the Draw handler.
                    hitPoints.Add(new IntPoint(x, y));

                    lastPointerX = x;
                    lastPointerY = y;
                }
            }

            canvas.Invalidate();
        }
開發者ID:jiatingxiu,項目名稱:Win2D,代碼行數:39,代碼來源:GameOfLife.xaml.cs

示例10: OnPointerMoved

        void OnPointerMoved(
            object sender, 
            PointerRoutedEventArgs e)
        {
            _gr.ProcessMoveEvents(
                e.GetIntermediatePoints(_window));

            PointerPoint pointer =
                e.GetCurrentPoint(_window);

            if (_pointers.ContainsKey(pointer.PointerId))
                _pointers[pointer.PointerId] = pointer;

            switch (_pointerMode)
            {
                case PointerMode.kBeginDragMode:

                    _previousPointerPos =
                        pointer.Position;

                    _pointerMode = PointerMode.kDragMode;
                    break;

                case PointerMode.kDragMode:

                    double xOffset =
                        _previousPointerPos.X -
                        pointer.Position.X;

                    double yOffset =
                        _previousPointerPos.Y -
                        pointer.Position.Y;

                    _dragDistance += GetDistance(
                       _previousPointerPos,
                       pointer.Position);

                    _previousPointerPos =
                        pointer.Position;

                    _renderer.Rotate(
                        (float)xOffset,
                        (float)yOffset);

                    break;

                case PointerMode.kScaleMode:

                    var pointers =
                        _pointers.Values.ToList();

                    double dist = GetDistance(
                        ToDeviceCoordinate(pointers[0].RawPosition),
                        ToDeviceCoordinate(pointers[1].RawPosition));

                    double accZoom =
                        _accumulator.Accumulate(dist);

                    _renderer.SetZoom((float)accZoom * 5.0f / 1000.0f);

                    break;

                case PointerMode.kIdleMode:

                   Point pos = ToDeviceCoordinate(
                        pointer.RawPosition);

                    _renderer.CheckPreSelection(
                         (float)pos.X,
                         (float)pos.Y);

                    break;

                default:
                    break;
            }
        }
開發者ID:DevNullx64,項目名稱:ADN-WinRT-Samples,代碼行數:77,代碼來源:AdnGestureManager.cs

示例11: OnPointerMoved

 private void OnPointerMoved(object sender, PointerRoutedEventArgs e)
 {
     _gr.ProcessMoveEvents(e.GetIntermediatePoints(null));
     e.Handled = true;
 }
開發者ID:frozenfroze,項目名稱:SlidePane,代碼行數:5,代碼來源:SlidePane.Interaction.cs

示例12: Element_PointerMoved

 private void Element_PointerMoved(object sender, PointerRoutedEventArgs e)
 {
     this.gestureRecognizer.ProcessMoveEvents(e.GetIntermediatePoints(this.element));
 }
開發者ID:sarthakbhol,項目名稱:Windows10AppSamples,代碼行數:4,代碼來源:MainPage.xaml.cs

示例13: OnPointerMoved

 void OnPointerMoved(object sender, PointerRoutedEventArgs args)
 {
     // Pass all intermediate points to the gesture recognizer.
     recognizer.ProcessMoveEvents(args.GetIntermediatePoints(Rect1));
 }
開發者ID:vulcanlee,項目名稱:Windows8Lab,代碼行數:5,代碼來源:MainPage.xaml.cs

示例14: OnPointerMoved

        private void OnPointerMoved(object sender, PointerRoutedEventArgs args)
        {
            Gesture.ProcessMoveEvents(args.GetIntermediatePoints(this.Parent as UIElement));

            args.Handled = true;
        }
開發者ID:TriForks,項目名稱:triforks-wp,代碼行數:6,代碼來源:RadiaMenu.xaml.cs

示例15: GestureRecognizerDemo_PointerMoved

 private void GestureRecognizerDemo_PointerMoved(object sender, PointerRoutedEventArgs e)
 {
     // 告訴 GestureRecognizer 指針移動中,以便 GestureRecognizer 做手勢監測
     _gestureRecognizer.ProcessMoveEvents(e.GetIntermediatePoints(null));
 }
開發者ID:simple0812,項目名稱:uwp,代碼行數:5,代碼來源:GestureService.cs


注:本文中的Windows.UI.Xaml.Input.PointerRoutedEventArgs.GetIntermediatePoints方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。