1

コードで doubleAniation を作成していて、それにイージング関数を追加したいのですが、どうすればよいですか?

4

3 に答える 3

5

これが私がそれをする方法です:

        DoubleAnimationUsingKeyFrames compassRoseAnimation = new DoubleAnimationUsingKeyFrames();
        compassRoseAnimation.Duration = new Duration(TimeSpan.FromSeconds(2));
        QuarticEase easingFunction = new QuarticEase();
        easingFunction.EasingMode = EasingMode.EaseInOut;
        EasingDoubleKeyFrame startAnimation = new EasingDoubleKeyFrame(previousRotationDegrees, KeyTime.FromPercent(0));
        EasingDoubleKeyFrame endAnimation = new EasingDoubleKeyFrame(newRotationDegrees, KeyTime.FromPercent(1.0), easingFunction);
        compassRoseAnimation.KeyFrames.Add(startAnimation);
        compassRoseAnimation.KeyFrames.Add(endAnimation);

        RotateTransform rotateTransform = new RotateTransform();
        CompassWithNumbersControl.RenderTransform = rotateTransform;
        rotateTransform.BeginAnimation(RotateTransform.AngleProperty, compassRoseAnimation);
于 2010-11-28T13:38:22.093 に答える
-1

私はそれを自分で理解しました。私は Easing プロパティを探していましたが、実際には KeySpline と呼ばれ、代わりに DoubleAniamtionUsingKeyFrames を使用してイージング機能を取得する必要があります。

于 2010-09-21T13:15:04.193 に答える