当前位置: 首页>>代码示例>>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;未经允许,请勿转载。