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


C# Input.ManipulationDeltaEventArgs类代码示例

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


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

示例1: OnManipulationDelta

        void OnManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            if (e.PinchManipulation != null)
            {
                e.Handled = true;

                if (!_pinching)
                {
                    _pinching = true;
                    Point center = e.PinchManipulation.Original.Center;
                    _relativeMidpoint = new Point(center.X / SystemMapImage.ActualWidth, center.Y / SystemMapImage.ActualHeight);

                    var xform = SystemMapImage.TransformToVisual(ImageViewPort);
                    _screenMidpoint = xform.Transform(center);
                }

                _scale = _originalScale * e.PinchManipulation.CumulativeScale;

                CoerceScale(false);
                ResizeImage(false);
            }
            else if (_pinching)
            {
                _pinching = false;
                _originalScale = _scale = _coercedScale;
            }
        }
开发者ID:CodeObsessed,项目名称:drumbleapp,代码行数:27,代码来源:Maps.xaml.cs

示例2: ImageGrid_ManipulationDelta

        private void ImageGrid_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            if (e.PinchManipulation != null)
            {
                //缩放
                _bokehManger.ScaleChange(e.PinchManipulation.DeltaScale);

                _bokehManger.RotationChange(e.PinchManipulation.Current, e.PinchManipulation.Original);

                TouchPanel.EnabledGestures = GestureType.None;
            }
            else
            {
                while (TouchPanel.IsGestureAvailable)
                {
                    GestureSample sample = TouchPanel.ReadGesture();
                    Point sampleDelta = new Point(sample.Delta.X, sample.Delta.Y);
                    _bokehManger.PositionChange(sampleDelta);
                }
                if (!TouchPanel.IsGestureAvailable)
                {
                    _bokehManger.SetPreAngel();
                }
            }
            _bokehManger.SetGradient();
        }
开发者ID:onionstyle,项目名称:BokehDemo,代码行数:26,代码来源:MainPage.xaml.cs

示例3: negro_ManipulationDelta_1

 // Al arrastrar el circulo.
 private void negro_ManipulationDelta_1(object sender, ManipulationDeltaEventArgs e)
 {
     FrameworkElement elipse = sender as FrameworkElement;
     elipse.RenderTransform = dragTranslation;
     dragTranslation.TranslateX = dragTranslation.TranslateX + e.DeltaManipulation.Translation.X;
     dragTranslation.TranslateY = dragTranslation.TranslateY + e.DeltaManipulation.Translation.Y;
 }
开发者ID:jacevedo,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs

示例4: OnManipulationDelta

 private void OnManipulationDelta(object Sender, ManipulationDeltaEventArgs DeltaRoutedEventArgs)
 {
     if (DeltaRoutedEventArgs.CumulativeManipulation.Translation.X < -30)
     {
         _gameGrid.HandleMove(MoveDirection.Left);
         DeltaRoutedEventArgs.Complete();
         DeltaRoutedEventArgs.Handled = true;
     }
     else if (DeltaRoutedEventArgs.CumulativeManipulation.Translation.X > 30)
     {
         _gameGrid.HandleMove(MoveDirection.Right);
         DeltaRoutedEventArgs.Complete();
         DeltaRoutedEventArgs.Handled = true;
     }
     else if (DeltaRoutedEventArgs.CumulativeManipulation.Translation.Y < -30)
     {
         _gameGrid.HandleMove(MoveDirection.Up);
         DeltaRoutedEventArgs.Complete();
         DeltaRoutedEventArgs.Handled = true;
     }
     else if (DeltaRoutedEventArgs.CumulativeManipulation.Translation.Y > 30)
     {
         _gameGrid.HandleMove(MoveDirection.Down);
         DeltaRoutedEventArgs.Complete();
         DeltaRoutedEventArgs.Handled = true;
     }
 }
开发者ID:andrecurvello,项目名称:2048,代码行数:27,代码来源:MainPage.xaml.cs

示例5: OnManipulationDelta

        protected override void OnManipulationDelta(ManipulationDeltaEventArgs e)
        {
            Card element = e.Source as Card;
            ManipulationDelta delta = e.DeltaManipulation;
            Point center = e.ManipulationOrigin;
            Matrix matrix = new Matrix();
            if (STATICS.MIN_CARD_SCALE < element.CurrentScale * delta.Scale.X && element.CurrentScale * delta.Scale.X < STATICS.MAX_CARD_SCALE)
            {
                element.CurrentScale = element.CurrentScale * delta.Scale.X;
                matrix.Scale(element.CurrentScale, element.CurrentScale);
            }
            else
            {
                matrix.Scale(element.CurrentScale, element.CurrentScale);
            }
            element.CurrentPosition = new Point(element.CurrentPosition.X + delta.Translation.X, element.CurrentPosition.Y + delta.Translation.Y);
            element.CurrentRotation += delta.Rotation;

            matrix.Rotate(element.CurrentRotation);
            matrix.Translate(element.CurrentPosition.X, element.CurrentPosition.Y);

            element.RenderTransform = new MatrixTransform(matrix);

            mainWindow.LinkingGestureLayer.Move(element);
            e.Handled = true;
            base.OnManipulationDelta(e);
        }
开发者ID:nius1989,项目名称:CardDesign_TechSnack,代码行数:27,代码来源:Card_Layer.xaml.cs

示例6: Border_ManipulationDelta

 private void Border_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
 {
     // suppress zoom
     if (e.DeltaManipulation.Scale.X != 0.0 ||
         e.DeltaManipulation.Scale.Y != 0.0)
         e.Handled = true;
 }
开发者ID:timextreasures,项目名称:WordPress-WindowsPhone,代码行数:7,代码来源:LicensesPage.xaml.cs

示例7: cropArea_ManipulationDelta

        private void cropArea_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            /**
             *  all of this code keeps the picture within the boundaries
             */

            drag.Y += e.DeltaManipulation.Translation.Y;
            if (drag.Y < 0)
                drag.Y = 0;
            if (drag.Y > max)
                drag.Y = max;

            int temp = current + (int)e.DeltaManipulation.Translation.Y;
            if (temp < min)
            {
                lowerBound.Height = originalPhoto.Height - cropArea.Height;
                upperBound.Height = 0;
                current = min;
            }
            else if (temp > max)
            {
                upperBound.Height = originalPhoto.Height - cropArea.Height;
                lowerBound.Height = 0;
                current = max;
            }
            else
            {
                upperBound.Height = temp;
                lowerBound.Height = max - temp;
                current = temp;
            }
        }
开发者ID:purdue-cs-groups,项目名称:cs307-project01,代码行数:32,代码来源:CropPage.xaml.cs

示例8: Element_ManipulationDelta

        private void Element_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            if (!IsEnabled)
            return;

              if (!IsActive)
              {
            // has the user dragged far enough?
            if (Math.Abs(e.CumulativeManipulation.Translation.X) < DragStartedDistance)
              return;

            IsActive = true;

            // initialize the drag
            FrameworkElement fe = sender as FrameworkElement;
            fe.SetHorizontalOffset(0);

            // find the container for the tick and cross graphics
            _tickAndCrossContainer = fe.Descendants()
                                   .OfType<FrameworkElement>()
                                   .Single(i => i.Name == "tickAndCross");
              }
              else
              {
            // handle the drag to offset the element
            FrameworkElement fe = sender as FrameworkElement;
            double offset = fe.GetHorizontalOffset().Value + e.DeltaManipulation.Translation.X;
            fe.SetHorizontalOffset(offset);

            _tickAndCrossContainer.Opacity = TickAndCrossOpacity(offset);
              }
        }
开发者ID:andersberglund,项目名称:WP7-ClearStyle,代码行数:32,代码来源:SwipeInteraction.cs

示例9: cropArea_ManipulationDelta

        private void cropArea_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            drag.X += e.DeltaManipulation.Translation.X;
            if (drag.X < 0)
                drag.X = 0;
            if (drag.X > max)
                drag.X = max;

            int temp = current + (int)e.DeltaManipulation.Translation.X;
            if (temp < min)
            {
                rightBound.Width = originalPhoto.Width - cropArea.Width;
                leftBound.Width = 0;
                current = min;
            }
            else if (temp > max)
            {
                leftBound.Width = originalPhoto.Width - cropArea.Width;
                rightBound.Width = 0;
                current = max;
            }
            else
            {
                leftBound.Width = temp;
                rightBound.Width = max - temp;
                current = temp;
            }
        }
开发者ID:purdue-cs-groups,项目名称:cs307-project01,代码行数:28,代码来源:CropPageLandscapeOrientation.xaml.cs

示例10: image_ManipulationDelta

        private void image_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            // Get the image that's being manipulated.            
            FrameworkElement element = (FrameworkElement)e.Source;

            // Use the matrix to manipulate the element.
            Matrix matrix = ((MatrixTransform)element.RenderTransform).Matrix;

            var deltaManipulation = e.DeltaManipulation;
            // Find the old center, and apply the old manipulations.
            Point center = new Point(element.ActualWidth / 2, element.ActualHeight / 2);
            center = matrix.Transform(center);

            // Apply zoom manipulations.
            matrix.ScaleAt(deltaManipulation.Scale.X, deltaManipulation.Scale.Y, center.X, center.Y);

            // Apply rotation manipulations.
            matrix.RotateAt(e.DeltaManipulation.Rotation, center.X, center.Y);

            // Apply panning.
            matrix.Translate(e.DeltaManipulation.Translation.X, e.DeltaManipulation.Translation.Y);

            // Set the final matrix.
            ((MatrixTransform)element.RenderTransform).Matrix = matrix;

        }
开发者ID:ittray,项目名称:LocalDemo,代码行数:26,代码来源:Manipulations.xaml.cs

示例11: StackPanel_ManipulationDelta

 private void StackPanel_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
 {
     /* if (e.DeltaManipulation.Translation.Y != 0)
          return;
      if (Event != null)
          Event(this, e);*/
 }
开发者ID:klyuchnikov,项目名称:SystemMonitoringForTheLearningProcess,代码行数:7,代码来源:StatisticGroupViewControl.xaml.cs

示例12: Border_ManipulationDelta

        private void Border_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            if (Math.Abs(e.DeltaManipulation.Translation.X) > Math.Abs(e.DeltaManipulation.Translation.Y))
                e.Handled = true;

            if (e.CumulativeManipulation.Scale.X != 0.0 || e.CumulativeManipulation.Scale.Y != 0.0)
                e.Handled = true;
        }
开发者ID:jlopresti,项目名称:TouchWebBrowserDecorator,代码行数:8,代码来源:TouchWebBrowserDecorator.cs

示例13: OnManipulationDelta

        protected override void OnManipulationDelta(ManipulationDeltaEventArgs e)
        {
            base.OnManipulationDelta(e);

            TransformMap(e.ManipulationOrigin,
                (Point)e.DeltaManipulation.Translation, e.DeltaManipulation.Rotation,
                (e.DeltaManipulation.Scale.X + e.DeltaManipulation.Scale.Y) / 2d);
        }
开发者ID:bhanu475,项目名称:XamlMapControl,代码行数:8,代码来源:Map.WPF.cs

示例14: ManipulationDelta

        public void ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            Manipulation(e);

            updateUserCursor();

            SetMarkers();
            e.Handled = true;
        }
开发者ID:gdlprj,项目名称:duscusys,代码行数:9,代码来源:VdArrow.cs

示例15: OnManipulationDelta

        protected override void OnManipulationDelta(ManipulationDeltaEventArgs args)
        {
            if (!manipulationDeltaInProgress)
            {
                IsActive = true;

                if (!tapInertiaInProgess)
                    SelectedIndex = -1;
            }

            manipulationDeltaInProgress = true;

            // This is the fake inertia from a tap
            if (tapInertiaInProgess)
            {
                VerticalOffset -= args.DeltaManipulation.Translation.Y;
            }

            // All other direct manipulation and inertia
            else
            {
                // For non-wrappable panel, check for end of the line
                if (!isWrappableStackPanel)
                {
                    double newVerticalOffset = VerticalOffset - inertiaDirection * args.DeltaManipulation.Translation.Y;

                    if (FractionalCenteredIndexFromVerticalOffset(newVerticalOffset, false) < 0)
                    {
                        double verticalOffsetIncrement = VerticalOffset - VerticalOffsetFromCenteredIndex(0);
                        double verticalOffsetExcess = args.DeltaManipulation.Translation.Y - verticalOffsetIncrement;
                        VerticalOffset -= verticalOffsetIncrement;
                        SelectedIndex = 0;
                        args.ReportBoundaryFeedback(new ManipulationDelta(new Vector(0, verticalOffsetExcess), 0, new Vector(), new Vector()));
                        args.Complete();
                    }
                    else if (FractionalCenteredIndexFromVerticalOffset(newVerticalOffset, false) > Items.Count - 1)
                    {
                        double verticalOffsetIncrement = VerticalOffsetFromCenteredIndex(Items.Count - 1) - VerticalOffset;
                        double verticalOffsetExcess = args.DeltaManipulation.Translation.Y - verticalOffsetIncrement;
                        VerticalOffset += verticalOffsetIncrement;
                        SelectedIndex = Items.Count - 1;
                        args.ReportBoundaryFeedback(new ManipulationDelta(new Vector(0, verticalOffsetExcess), 0, new Vector(), new Vector()));
                        args.Complete();
                    }
                }

                // Here's where scrolling might reverse itself
                if (args.IsInertial && inertiaToUnknownIndex && !reverseInertiaChecked)
                    CheckForBackupManeuver(VerticalOffset, args.DeltaManipulation.Translation.Y, args.Velocities.LinearVelocity.Y);

                // This is the normal direct manipulation and inertia
                VerticalOffset -= inertiaDirection * args.DeltaManipulation.Translation.Y;
            }

            base.OnManipulationDelta(args);
        }
开发者ID:BoonieBear,项目名称:TinyMetro,代码行数:56,代码来源:WindowedItemsControl.Manipulation.cs


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