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


C# Windows.GetCurrentPoint方法代码示例

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


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

示例1: Zoom

        public void Zoom(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var mousePoint = e.GetCurrentPoint(null).Position;
            var wheel = e.GetCurrentPoint(null).Properties.MouseWheelDelta / 120;
            var zoom = Math.Exp(wheel * ZoomIntensity);

            _zoom(zoom, mousePoint.X, mousePoint.Y);
        }
开发者ID:liquidboy,项目名称:X,代码行数:8,代码来源:Canvas.cs

示例2: uiElement_PointerMoved

        protected virtual void uiElement_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (moveD3dCanvas)
            {
                var newPosition = e.GetCurrentPoint(null);
                double deltaX = newPosition.Position.X - lastPos.Position.X;
                double deltaY = newPosition.Position.Y - lastPos.Position.Y;

                // Only support CompositeTransform and TranslateTransform
                // Is there any better way to handle this?
                if (uiElement.RenderTransform is CompositeTransform)
                {
                    var compositeTransform = (CompositeTransform)uiElement.RenderTransform;
                    compositeTransform.TranslateX += deltaX;
                    compositeTransform.TranslateY += deltaY;
                }
                else if (uiElement.RenderTransform is TranslateTransform)
                {
                    var translateTransform = (TranslateTransform)uiElement.RenderTransform;
                    translateTransform.X += deltaX;
                    translateTransform.Y += deltaY;
                }

                lastPos = newPosition;
            }
        }
开发者ID:vulcanlee,项目名称:Windows8Lab,代码行数:26,代码来源:DragHandler.cs

示例3: DynamicArea_PointerReleased

        void DynamicArea_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if(_firstPoint == null)
            {
                return;
            }

            var secondPoint = e.GetCurrentPoint(null);

            if(secondPoint.PointerId == _firstPoint.PointerId)
            {
                var deltaX = secondPoint.Position.X - _firstPoint.Position.X;
                var deltaY = secondPoint.Position.Y - _firstPoint.Position.Y;
               
                // Horizontal scrolling
                if(Math.Abs(deltaX) >  Math.Abs(deltaY))
                {
                    var left = deltaX > 0;
                    if(left)
                    {
                        ((BasicMonthViewModel)this.DataContext).ExecutePrevious(null);
                    }
                    else
                    {
                        ((BasicMonthViewModel)this.DataContext).ExecuteNext(null);
                    }
                }
            }
        }
开发者ID:nghia2080,项目名称:CProject,代码行数:29,代码来源:BasicMonthPage.xaml.cs

示例4: OnPointerReleased

        private void OnPointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
        {
            Windows.UI.Input.PointerPoint currentPoint = args.GetCurrentPoint(this._reference);
            this._gestureRecognizer.ProcessUpEvent(currentPoint);
            this._target.ReleasePointerCapture(args.Pointer);

            // Mark event handled, to prevent execution of default event handlers
            args.Handled = true;
        }
开发者ID:paraneye,项目名称:WinApp,代码行数:9,代码来源:InputProcessor.cs

示例5: OnPointerPressed

 void OnPointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
 {
     // Route teh events to the gesture recognizer
     this.gestureRecognizer.ProcessDownEvent(args.GetCurrentPoint(this.element));
     // Set the pointer capture to the element being interacted with
     this.element.CapturePointer(args.Pointer);
     // Mark the event handled to prevent execution of default handlers
     args.Handled = true;
 }
开发者ID:oldnewthing,项目名称:old-Windows8-samples,代码行数:9,代码来源:S1-Gestures.xaml.cs

示例6: OnPointerPressed

        private void OnPointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
        {
            // Obtain current point in the coordinate system of the reference element
            Windows.UI.Input.PointerPoint currentPoint = args.GetCurrentPoint(this._reference);
            this._gestureRecognizer.ProcessDownEvent(currentPoint);
            this._target.CapturePointer(args.Pointer);

            args.Handled = true;
        }
开发者ID:paraneye,项目名称:WinApp,代码行数:9,代码来源:InputProcessor.cs

示例7: OnPointerPressed

 public override void OnPointerPressed(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     PointerPoint point = e.GetCurrentPoint(Map);
     oldMouseX = point.Position.X;
     oldMouseY = point.Position.Y;
     isMouseCaptured = true;
     Map.CapturePointer(e.Pointer);
     e.Handled = true;
     base.OnPointerPressed(e);
 }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:10,代码来源:OvPan.cs

示例8: EventIsSelect

    public static bool EventIsSelect(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
    {
        var pointerProperties = e.GetCurrentPoint(null).Properties;

        bool rval = false
            || (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen && pointerProperties.IsBarrelButtonPressed)
            || (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse && pointerProperties.IsLeftButtonPressed && e.KeyModifiers == Windows.System.VirtualKeyModifiers.Control);

        return rval;
    }
开发者ID:oldnewthing,项目名称:old-Windows8-samples,代码行数:10,代码来源:Helpers.cs

示例9: EventIsErase

    public static bool EventIsErase(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
    {
        var pointerProperties = e.GetCurrentPoint(null).Properties;

        bool rval = false
            || (pointerProperties.IsEraser)
            || (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen && !pointerProperties.IsBarrelButtonPressed && pointerProperties.IsRightButtonPressed)
            || (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse && pointerProperties.IsRightButtonPressed);

        return rval;
    }
开发者ID:oldnewthing,项目名称:old-Windows8-samples,代码行数:11,代码来源:Helpers.cs

示例10: OnPointerWheelChanged

        private void OnPointerWheelChanged(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs args)
        {
            Windows.UI.Input.PointerPoint currentPoint = args.GetCurrentPoint(this._reference);

            bool shift = (args.KeyModifiers & Windows.System.VirtualKeyModifiers.Shift) == Windows.System.VirtualKeyModifiers.Shift;
            bool ctrl = (args.KeyModifiers & Windows.System.VirtualKeyModifiers.Control) == Windows.System.VirtualKeyModifiers.Control;

            // Route the event to the gesture recognizer
            this._gestureRecognizer.ProcessMouseWheelEvent(currentPoint, shift, ctrl);
            args.Handled = true;
        }
开发者ID:paraneye,项目名称:WinApp,代码行数:11,代码来源:InputProcessor.cs

示例11: OnPointerMoved

        private void OnPointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var currentPoint = e.GetCurrentPoint(MapCanvas);

            HighlightedTile = ScreenToMap(
                new Vector2((float)currentPoint.Position.X,
                            (float)currentPoint.Position.Y));

            MapCanvas.Invalidate();

            e.Handled = true;
        }
开发者ID:sgreenlay,项目名称:IsoMap,代码行数:12,代码来源:IsometricMapControl.xaml.cs

示例12: OnPointerWheelChanged

        private async void OnPointerWheelChanged(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var point = e.GetCurrentPoint(this);

            double offset = -point.Properties.MouseWheelDelta / 20.0;
            double delta = -Math.Sign(offset) * 20;

            for (int n = 0; n < Math.Abs(offset); n++)
            {
                await TranslateDelta(delta);
                await Task.Delay(10);
            }
        }
开发者ID:ridomin,项目名称:waslibs,代码行数:13,代码来源:HtmlViewer.Gestures.cs

示例13: RadialControl_PointerMoved

        void RadialControl_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if ((!IsOuterDrawing) && (!IsInnerDrawing))
                return;

            ClearOldStrips();

            if (IsOuterDrawing)
            {
                _outerCurrentPoint = e.GetCurrentPoint(this).Position;

                var circleStart = new Point(_startPoint.X, _startPoint.Y - OuterRingRadius);

                //Calculate the angle
                var angle = _mathHelper.AngleBetweenLine(_startPoint, circleStart, _outerCurrentPoint, OuterRingRadius);

                var rawValue = CreateSegment(Name + "OuterRadialStrip", OuterRingRadius, _outerCurrentPoint, OuterRingColor, angle);
                OuterCurrentValue = (int)(rawValue * (OuterRingMaxValue + 1));

                UpdateGripControlPosition(_outerGripControl, angle, OuterRingRadius);
            }
            else
            {
                _innerCurrentPoint = new Point(e.GetCurrentPoint(this).Position.X, e.GetCurrentPoint(this).Position.Y);

                var circleStart = new Point(_startPoint.X, _startPoint.Y - InnerRingRadius);

                //Calculate the angle
                var angle = _mathHelper.AngleBetweenLine(_startPoint, circleStart, _innerCurrentPoint, InnerRingRadius);

                var rawValue = CreateSegment(Name + "InnerRadialStrip", InnerRingRadius, _innerCurrentPoint, InnerRingColor, angle);
                InnerCurrentValue = (int)(rawValue * (InnerRingMaxValue + 1));

                UpdateGripControlPosition(_innerGripControl, angle, InnerRingRadius);
            }
        }
开发者ID:HimanshPal,项目名称:Naylah.Toolkit.UWP,代码行数:36,代码来源:CircularSliderControl.cs

示例14: OnPointerMoved

        public override void OnPointerMoved(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (isMouseCaptured)
            {
                PointerPoint point = e.GetCurrentPoint(Map);
                double newMouseX = point.Position.X;
                double newMouseY = point.Position.Y;
                double deltaX;
                double deltaY;
                deltaX = newMouseX - oldMouseX;
                deltaY = newMouseY - oldMouseY;

                Map.PanByPixel(-deltaX, -deltaY);

                oldMouseY = point.Position.Y;
                oldMouseX = point.Position.X;
            }
            base.OnPointerMoved(e);
        }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:19,代码来源:OvPan.cs

示例15: OnPointerMoved

 /// <summary>${ui_action_FrawFreeLine_event_OnPointerMoved_D}</summary>
 public override void OnPointerMoved(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     if (isDrawing)
     {
         Point2D item = Map.ScreenToMap(e.GetCurrentPoint(Map).Position);
         points.Add(item);
     }
     base.OnPointerMoved(e);
 }
开发者ID:SuperMap,项目名称:iClient-for-Win8,代码行数:10,代码来源:DrawFreeLine.cs


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