locked
Making an image move very slowly across the screen

    Question

  • I am using the following to move images:-

    PublicSubanimateCard(ByReftransform AsCompositeTransform, ByValtargetPoint AsPoint, ByValtargetRotation AsInteger, ByValdurationMS AsInteger, ByValdelayMS AsInteger)

           

    Dimsb AsAnimation.Storyboard= NewAnimation.Storyboard


            sb.Duration =

    NewDuration(TimeSpan.FromMilliseconds(durationMS + delayMS))

            sb.BeginTime =

    TimeSpan.FromMilliseconds(delayMS)

           

    DimXAnim AsAnimation.DoubleAnimation= NewAnimation.DoubleAnimation


           

    WithXAnim

                .To = targetPoint.X

                .Duration =

    NewDuration(TimeSpan.FromMilliseconds(durationMS))

           

    EndWith


           

    DimYAnim AsAnimation.DoubleAnimation= NewAnimation.DoubleAnimation


           

    WithYAnim

                .To = targetPoint.Y

                .Duration =

    NewDuration(TimeSpan.FromMilliseconds(durationMS))

           

    EndWith


           

    DimRotateAnim AsAnimation.DoubleAnimation= NewAnimation.DoubleAnimation


           

    WithRotateAnim

                .To = targetRotation

                .Duration =

    NewDuration(TimeSpan.FromMilliseconds(durationMS))

           

    EndWith


            Animation.

    Storyboard.SetTarget(XAnim, transform)

            Animation.

    Storyboard.SetTarget(YAnim, transform)

            Animation.

    Storyboard.SetTarget(RotateAnim, transform)

            Animation.

    Storyboard.SetTargetProperty(XAnim, "TranslateX")

            Animation.

    Storyboard.SetTargetProperty(YAnim, "TranslateY")

            Animation.

    Storyboard.SetTargetProperty(RotateAnim, "Rotation")

            sb.Children.Add(XAnim)

            sb.Children.Add(YAnim)

            sb.Children.Add(RotateAnim)

           

    Dima AsQuadraticEase= NewQuadraticEase


            a.EasingMode =

    EasingMode.EaseOut

           

    'XAnim.EasingFunction = a


           

    'YAnim.EasingFunction = a


           

    'RotateAnim.EasingFunction = a


            sb.Begin()

       

    EndSub

    This works fine for a quick smooth move to another point but what I now wish to do is move the image very slowly from point to point. Changing the duration and delay can slow down a bit but it is still a very fast move. Any suggestions on how to make it move VERY slowly?

    Thank you

    Malcolm Bain


    Malcolm Bain

    Thursday, October 02, 2014 10:27 AM

Answers

  • Please post code snippets in a code block rather than free form. It will be easier to read and less likely to have it's formatting corrupted. The code as posted list Whitehouse and won't compile.

    That said, the way to slow down the move is to increase the duration of the animation. The speed is based on the distance moved and the duration to move that distance.

    If you need it slower then increase the duration more.

    • Marked as answer by Malcnoo Thursday, October 02, 2014 2:53 PM
    Thursday, October 02, 2014 12:50 PM
    Owner