private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            border.Background = redBrush;

            initialAngle = transform.Rotation;
            initialScale = transform.ScaleX;
        }
Пример #2
0
        private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            initialAngle = transform.Rotation;
            initialScale = transform.ScaleX;

            //flickData.Text = string.Format(" OnPinchStarted: Angle = {0}, Distance = {1}",
            //   Math.Round(e.Angle), e.Distance);
        }
Пример #3
0
        private void BeginTextZoom(object sender, PinchStartedGestureEventArgs e)
        {
            // allow only horizontal pinches
            var angle = Math.Abs(e.Angle);

            _allowZoom = ((angle >= 80) && (angle <= 100)) ||
                         ((angle <= 290) && (angle >= 250));
        }
        private void EditorImage_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            if (this.selectedMode == MODE_SCROLL)
            {
                e.Handled = true;

                this.initialScale = this.currentScale;
            }
        }
Пример #5
0
        private void gesture_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            var point  = e.GetPosition(ContentPanel, 0);
            var point2 = e.GetPosition(ContentPanel, 1);

            message.Text = string.Format("pinch started at ({0},{1}) and ({1},{2}) with angle {3} and distance {4}",
                                         point.X, point.Y, point2.X, point2.Y, e.Angle, e.Distance);
            flickMessage.Text = null;
        }
Пример #6
0
        private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            // Store the initial rotation angle and scaling
            InitialScale = ImageTransformation.ScaleX;
            // Calculate the center for the zooming
            Point firstTouch  = e.GetPosition(photo, 0);
            Point secondTouch = e.GetPosition(photo, 1);

            Center = new Point(firstTouch.X + (secondTouch.X - firstTouch.X) / 2.0, firstTouch.Y + (secondTouch.Y - firstTouch.Y) / 2.0);
        }
Пример #7
0
        private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            if (isAnimating)
            {
                return;
            }

            oldFinger1     = e.GetPosition(_content, 0);
            oldFinger2     = e.GetPosition(_content, 1);
            oldScaleFactor = 1;
            e.Handled      = true;
        }
Пример #8
0
        void gl_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            _initialScale = scale.ScaleX;

            // calculate the center for the zooming
            Point firstTouch  = e.GetPosition(gameGrid, 0);
            Point secondTouch = e.GetPosition(gameGrid, 1);

            Point center = new Point(firstTouch.X + (secondTouch.X - firstTouch.X) / 2.0,
                                     firstTouch.Y + (secondTouch.Y - firstTouch.Y) / 2.0);

            scale.CenterX = center.X;
            scale.CenterY = center.Y;

            //UpdateLayout();
        }
Пример #9
0
        private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            // store the initial rotation angle and scaling
            initialScale = ImageTransformation.ScaleX;
            // calculate the center for the zooming
            Point firstTouch  = e.GetPosition(DetailImage, 0);
            Point secondTouch = e.GetPosition(DetailImage, 1);

            double centerX = firstTouch.X + (secondTouch.X - firstTouch.X) / 2.0;
            double centerY = firstTouch.Y + (secondTouch.Y - firstTouch.Y) / 2.0;

            center = new Point(centerX, centerY);

            _oldFinger1     = e.GetPosition(DetailImage, 0);
            _oldFinger2     = e.GetPosition(DetailImage, 1);
            _oldScaleFactor = 1;
        }
Пример #10
0
        private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            if (!CanZoom)
            {
                return;
            }

            var img       = sender as FrameworkElement;
            var transform = img.RenderTransform as CompositeTransform;

            _old.CenterX    = transform.CenterX;
            _old.CenterY    = transform.CenterY;
            _old.TranslateX = transform.TranslateX;
            _old.TranslateY = transform.TranslateY;
            _old.ScaleX     = transform.ScaleX;
            _old.ScaleY     = transform.ScaleY;
            _initialScale   = transform.ScaleX;
        }
Пример #11
0
        private void OnGestureListenerPinchStarted(object sender, PinchStartedGestureEventArgs args)
        {
            _isPinching = args.OriginalSource == image;

            if (_isPinching)
            {
                // Set transform centers
                Point ptPinchCenter = args.GetPosition(image);
                ptPinchCenter = previousTransform.Transform(ptPinchCenter);

                scaleTransform.CenterX = ptPinchCenter.X;
                scaleTransform.CenterY = ptPinchCenter.Y;

                rotateTransform.CenterX = ptPinchCenter.X;
                rotateTransform.CenterY = ptPinchCenter.Y;

                _ptPinchPositionStart = args.GetPosition(this);
            }
        }
Пример #12
0
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _initialAngle = MyMustacheTransformation.Rotation;
     _initialScale = MyMustacheTransformation.ScaleX;
 }
Пример #13
0
 private void OnPinchStarted(object s, PinchStartedGestureEventArgs e)
 {
     _fingerOne     = e.GetPosition(MyImage, 0);
     _fingerTwo     = e.GetPosition(MyImage, 1);
     _previousScale = 1;
 }
Пример #14
0
 /*ピンチアウトする前にサイズを保存しておきます、コメントアウトを外すと回転もできます。*/
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     //initialAngle = transform.Rotation;
     initialScale = transform.ScaleX;
 }
Пример #15
0
 private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     ReportGesture("Pinch Started");
 }
Пример #16
0
 private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _oldFinger1     = e.GetPosition(MapImage, 0);
     _oldFinger2     = e.GetPosition(MapImage, 1);
     _oldScaleFactor = 1;
 }
Пример #17
0
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     initialScale = transform.ScaleX;
 }
Пример #18
0
 /// <summary>
 /// Initializes the zooming operation
 /// </summary>
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _oldFinger1     = e.GetPosition(CameraImage, 0);
     _oldFinger2     = e.GetPosition(CameraImage, 1);
     _oldScaleFactor = 1;
 }
 private void OnGestureListenerPinchStarted(object sender, PinchStartedGestureEventArgs args)
 {
     this.initialScale      = this.transform.ScaleX;
     this.transform.CenterX = this.MyImage.ActualWidth / 2.0;
     this.transform.CenterY = this.MyImage.ActualHeight / 2.0;
 }
Пример #20
0
        // I don't think there's a simpler way to disable panning on a map
        // rolling out an EventToCommand behavior seems a bit much

        private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            oldZoom = Zoom;
        }
Пример #21
0
 private void OnLayoutPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     this._measurePinch             = true;
     PageManager.IgnoreInteractions = true;
 }