コード例 #1
0
        private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            border.Background = redBrush;

            initialAngle = transform.Rotation;
            initialScale = transform.ScaleX;
        }
 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;
 }
コード例 #3
0
ファイル: ComicPage.xaml.cs プロジェクト: rv1/XKCD_Browser
        private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            // Store the initial rotation angle and scaling
            InitialScale = ImageTransformation.ScaleX;
            // Calculate the center for the zooming
            System.Windows.Point firstTouch = e.GetPosition(ComicImage, 0);
            System.Windows.Point secondTouch = e.GetPosition(ComicImage, 1);

            Center = new System.Windows.Point(firstTouch.X + (secondTouch.X - firstTouch.X) / 2.0, firstTouch.Y + (secondTouch.Y - firstTouch.Y) / 2.0);
        }
コード例 #4
0
ファイル: FacPage.xaml.cs プロジェクト: nuieee/win-rt-feup
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     Point point0 = e.GetPosition(image, 0);
     Point point1 = e.GetPosition(image, 1);
     Point midpoint = new Point((point0.X + point1.X) / 2, (point0.Y + point1.Y) / 2);
     image.RenderTransformOrigin = new Point(midpoint.X / image.ActualWidth, midpoint.Y / image.ActualHeight);
     //initialAngle = transform.Rotation;
     initialScale = transform.ScaleX;
     image.Opacity = 0.8;
 }
コード例 #5
0
        private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            _initialAngle = MyMustacheTransformation.Rotation;
            _initialScale = MyMustacheTransformation.ScaleX;

            Point firstTouch = e.GetPosition(myMustache, 0);
            Point secondTouch = e.GetPosition(myMustache, 1);

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

            MyMustacheTransformation.CenterX = center.X;
            MyMustacheTransformation.CenterY = center.Y;
        }
コード例 #6
0
ファイル: ImageBrowse.xaml.cs プロジェクト: chwzou/WP7Fanfou
        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);
            }
        }
コード例 #7
0
        private void gestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            if (imageMan == null)
                return;

            Interlocked.CompareExchange(ref zooming, 1, 0);
            _oldFinger1 = e.GetPosition(image, 0);
            _oldFinger2 = e.GetPosition(image, 1);
            _oldScaleFactor = 1;
            image.Source = imageMan.finalImage;
        }
コード例 #8
0
 private void myGridGestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _originalScale = _scale;
 }
コード例 #9
0
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _initialAngle = MyMustacheTransformation.Rotation;
     _initialScale = MyMustacheTransformation.ScaleX;
 }
コード例 #10
0
 /// <summary>
 /// 手势操作开始
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _initialScale = _imgTrans.ScaleX;
 }
コード例 #11
0
        /// <summary>
        /// Initializes the zooming operation
        /// </summary>
        private static void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            ImageZoomerSettings settings;
             Image image = sender as Image;

             if (image == null)
            return;

             if (Images.TryGetValue(image, out settings))
             {
            settings.oldFinger1 = e.GetPosition(image, 0);
            settings.oldFinger2 = e.GetPosition(image, 1);
            settings.oldScaleFactor = 1;
             }
        }
コード例 #12
0
ファイル: Maps.xaml.cs プロジェクト: CodeObsessed/drumbleapp
 /// <summary>
 /// Initializes the zooming operation
 /// </summary>
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _oldFinger1 = e.GetPosition(ImgZoom, 0);
     _oldFinger2 = e.GetPosition(ImgZoom, 1);
     _oldScaleFactor = 1;
 }
コード例 #13
0
 void gestures_PinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _oldFinger1 = e.GetPosition(theThingToZoom, 0);
     _oldFinger2 = e.GetPosition(theThingToZoom, 1);
     _oldScaleFactor = 1;
 }
コード例 #14
0
 /// <summary>
 /// Pinch started
 /// </summary>
 /// <param name="sender">Event sender</param>
 /// <param name="e">Event parameter</param>
 void GestureListener_PinchStarted(
         object sender,
         PinchStartedGestureEventArgs e)
 {
   _pinchdownmat = _mat;
   _pinchdown = _mat.Transform(e.GetPosition(_img));
 }
コード例 #15
0
 private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _oldFinger1 = e.GetPosition(ZoomableImage, 0);
     _oldFinger2 = e.GetPosition(ZoomableImage, 1);
     _oldScaleFactor = 1;
 }
コード例 #16
0
 private void ListenerPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     Invoke(e);
 }
コード例 #17
0
        // we only need to keep track of translation
        // and for translation, we only care about the middle
        // position of the two fingers
        // OK, so the correct translation/scale we want to perform is:
        //
        //    1. move the initial middle of the two finger back to the initial translation
        //    2. scale up by the current scaling
        //    3. move back to the current middle of the two fingers
        //
        // If,
        //       if1, if2: are the initial finger touch
        //       translationRef:  is the initial translation
        //       s: is the current scaling factor [this is e.DistanceRatio]
        //              e.DistanceRaio is the currentDistanceBetweenFingers/initDistanceBetweenFingers
        //       cf1, cf1: is the current finger position
        //
        // what we want is:
        //
        //       im = 0.5 * (if1 + if2)             <-- middle position of the two initial finger position
        //       deltaVec = translationRef - im   <-- translate back by im
        //       cm = 0.5 * (cf1 + cf2)             <-- middle position of the two current finger position
        //
        // Translation:  cm + (deltaVec * s)
        //
        private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            Point if1 = e.GetPosition(this.mImageRectangle, 0);      // position of first finger
            Point if2 = e.GetPosition(this.mImageRectangle, 1);      // position of second finger
            Point im = new Point((0.5f * (if1.X + if2.X)),      // middle between the two fingers
                                 (0.5f * (if1.Y + if2.Y)));

            CompositeTransform t = this.imageToShow.Transform as CompositeTransform;
            this.translationRef.X = t.TranslateX;
            this.translationRef.Y = t.TranslateY;
            this.scaleRef = t.ScaleX;  // X and Y scales are always the same in our case

            // deltaVec will take the middle of initial touch position to the
            // initial translation position. This will give the proper effect of
            // scaling with respect to the initial touch position
            this.deltaVec.X = this.translationRef.X - im.X;
            this.deltaVec.Y = this.translationRef.Y - im.Y;
        }
コード例 #18
0
 private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     mapScale = BackMap.ZoomLevel;
 }
コード例 #19
0
 private void OnPinchStarted(object s, PinchStartedGestureEventArgs e)
 {
     initialScale = ((CompositeTransform)imgPhotos.RenderTransform).ScaleX;
 }
コード例 #20
0
ファイル: MainPage.xaml.cs プロジェクト: EPSILab/EPSITangram
        /// <summary>
        /// Déclenché lorsque l'utilisateur a posé ses deux doigts sur l'écran afin de zoomer ou rotater une image
        /// </summary>
        /// <param name="sender">Image sélectionnée par l'utilisateur</param>
        /// <param name="e"></param>
        private void GestureListener_OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
        {
            Image image = (Image)sender;

            ContentPanel.Children.Remove(image);
            ContentPanel.Children.Add(image);

            _transform = (CompositeTransform)image.RenderTransform;

            _initialAngle = _transform.Rotation;
            _initialScale = _transform.ScaleX;
        }
コード例 #21
0
 private void OnPinchStarted(object s, PinchStartedGestureEventArgs e)
 {
     _oldFinger1 = e.GetPosition(bigPicture, 0);
     _oldFinger2 = e.GetPosition(bigPicture, 1);
     _oldScaleFactor = 1;
 }
コード例 #22
0
ファイル: MapView.xaml.cs プロジェクト: xximjasonxx/Codemash
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
 }
コード例 #23
0
 private void OnLayoutPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     this._measurePinch = true;
     PageManager.IgnoreInteractions = true;
 }
コード例 #24
0
ファイル: MainPage.xaml.cs プロジェクト: shrimmy/SteadyJetty
 private void GestureListener_PinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     initialScale = tideImage.ScaleX;
 }
コード例 #25
0
 private void OnPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     initialAngle = transform.Rotation;
     initialScale = transform.ScaleX;
 }
コード例 #26
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));
 }
コード例 #27
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;
        }
コード例 #28
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; 
        }
 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;
 }
コード例 #30
0
ファイル: MapView.xaml.cs プロジェクト: soleon/Travlexer
 private void OnMapPinchStarted(object sender, PinchStartedGestureEventArgs e)
 {
     _context.CommandStopTrackingCurrentLocation.ExecuteIfNotNull();
 }