SplinePointKeyFrame クラス

定義

スプライン補間を使用して、前のキー フレームの Point 値から独自の Value にアニメーション化します。

public ref class SplinePointKeyFrame sealed : PointKeyFrame
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SplinePointKeyFrame final : PointKeyFrame
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class SplinePointKeyFrame final : PointKeyFrame
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SplinePointKeyFrame : PointKeyFrame
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class SplinePointKeyFrame : PointKeyFrame
Public NotInheritable Class SplinePointKeyFrame
Inherits PointKeyFrame
<SplinePointKeyFrame .../>
継承
Object Platform::Object IInspectable DependencyObject PointKeyFrame SplinePointKeyFrame
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

この XAML の例では、楕円を三角形のパスに沿って移動します。 この例では、PointAnimationUsingKeyFrames クラスを使用して、EllipseGeometryCenter プロパティをアニメーション化します。 このアニメーションは、次の方法で 3 つのキー フレームを使用します。

  1. 前半の 2 分の 1 の間、 LinearPointKeyFrame クラスのインスタンスを使用して、開始位置から安定した速度で楕円をパスに沿って移動します。 LinearPointKeyFrame などの線形キー フレームは、値間の滑らかな線形補間を作成します。
  2. 次の 5 分の 1 の間に、 DiscretePointKeyFrame クラスのインスタンスを使用して、パスに沿って楕円を次の位置に突然移動します。 DiscretePointKeyFrame などの個別のキー フレームでは、値間の急激なジャンプが作成されます。
  3. 最後の 2 秒間は、SplinePointKeyFrame クラスのインスタンスを使用して、楕円を開始位置に戻します。 SplinePointKeyFrame などのスプライン キー フレームは、 KeySpline プロパティの値に従って値間の変数遷移を作成します。 この例では、アニメーションは最初はゆっくりしていますが、時間セグメントの終点に向かって急激に速くなります。
<Canvas Width="400" Height="300">
    <Canvas.Resources>
        <Storyboard x:Name="myStoryboard">

            <!-- Animating the Center property uses 3 KeyFrames, which animate
             the ellipse allong a triangular path. -->
            <PointAnimationUsingKeyFrames
          Storyboard.TargetProperty="Center"
          Storyboard.TargetName="MyAnimatedEllipseGeometry"
          Duration="0:0:5" RepeatBehavior="Forever" EnableDependentAnimation="True">

                <!-- Over the first half second, Using a LinearPointKeyFrame, the ellipse 
               moves steadily from its starting position along the first line of the 
               trianglar path.  -->
                <LinearPointKeyFrame KeyTime="0:0:0.5" Value="100,300" />

                <!-- Using a DiscretePointKeyFrame, the ellipse suddenly changes position
               after the first second of the animation. -->
                <DiscretePointKeyFrame KeyTime="0:0:1" Value="400,300" />

                <!-- Using a SplinePointKeyFrame, the ellipse moves back to its starting
               position. It moves slowly at first and then speeds up. This key frame 
               takes 2 seconds to complete. -->
                <SplinePointKeyFrame KeySpline="0.6,0.0 0.9,0.00" 
                 KeyTime="0:0:3" Value="200,100" />
            </PointAnimationUsingKeyFrames>
        </Storyboard>
    </Canvas.Resources>
    <Path Fill="Blue" Loaded="Start_Animation">
        <Path.Data>

            <!-- Describes an ellipse. -->
            <EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
             Center="200,100" RadiusX="15" RadiusY="15" />
        </Path.Data>
    </Path>
</Canvas>
// Start the animation when the object loads
private void Start_Animation(object sender, RoutedEventArgs e)
{
    myStoryboard.Begin();
}
' Start the animation when the object loads
Private Sub Start_Animation(ByVal sender As Object, ByVal e As EventArgs)
    myStoryboard.Begin()
End Sub

注釈

キー フレーム アニメーションでは、アニメーション タイムラインに沿ってポイントに到達する複数のターゲット値を使うことができます。 つまり、キー フレームごとに異なる中間値も指定でき、到達した最後のキー フレームが最終的なアニメーション値になります。 複数の値を指定してアニメーション化を行うことで、より複雑なアニメーションを実現できます。 ディスクリート、リニア、スプラインのキーフレームを同じキーフレーム コレクションに混在させることができます。

キー フレーム アニメーションの使用方法の詳細については、「 キー フレーム アニメーションとイージング関数アニメーション」を参照してください。

コンストラクター

SplinePointKeyFrame()

SplinePointKeyFrame クラスの新しいインスタンスを初期化します。

プロパティ

Dispatcher

このオブジェクトが関連付けられている CoreDispatcher を取得します。 CoreDispatcher は、コードが UI 以外のスレッドによって開始された場合でも、UI スレッド上の DependencyObject にアクセスできる機能を表します。

(継承元 DependencyObject)
KeySpline

このキー フレームのアニメーションの進行を定義する 2 つの制御点を取得または設定します。

KeySplineProperty

KeySpline 依存関係プロパティを識別します。

KeyTime

キー フレームのターゲット に到達する時刻を取得または設定します。

(継承元 PointKeyFrame)
Value

キー フレームのターゲット値を取得または設定します。

(継承元 PointKeyFrame)

メソッド

ClearValue(DependencyProperty)

依存関係プロパティのローカル値をクリアします。

(継承元 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

依存関係プロパティに対して確立された基本値を返します。これは、アニメーションがアクティブでない場合に適用されます。

(継承元 DependencyObject)
GetValue(DependencyProperty)

DependencyObject から依存関係プロパティの現在の有効な値を返します。

(継承元 DependencyObject)
ReadLocalValue(DependencyProperty)

ローカル値が設定されている場合は、依存関係プロパティのローカル値を返します。

(継承元 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

この DependencyObject インスタンスの特定の DependencyProperty に対する変更をリッスンするための通知関数を登録します。

(継承元 DependencyObject)
SetValue(DependencyProperty, Object)

DependencyObject の依存関係プロパティのローカル値を設定します。

(継承元 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

RegisterPropertyChangedCallback を呼び出して以前に登録した変更通知を取り消します。

(継承元 DependencyObject)

適用対象

こちらもご覧ください