Share via


IXRKeySpline (Compact 2013)

3/28/2014

This class is used by a spline key frame to define animation progress.

Syntax

class IXRKeySpline : public IXRDependencyObject

Inheritance Hierarchy

IXRDependencyObject

    IXRKeySpline

Methods

Method

Description

IXRKeySpline::GetControlPoint1

Retrieves the first control point used to define a Bézier curve that describes this key spline.

IXRKeySpline::GetControlPoint2

Retrieves the second control point used to define a Bézier curve that describes this key spline.

IXRKeySpline::SetControlPoint1

Sets the first control point used to define a Bézier curve that describes this key spline.

IXRKeySpline::SetControlPoint2

Sets the second control point used to define a Bézier curve that describes this key spline.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

You can use IXRKeySpline to calculate a curved line that represents the rate of interpolation over the duration of the animation. The starting point, endpoint, two control points on the line each affect the shape of the adjacent curve.

Key splines drawn on a coordinate system always have the starting point at (0,0) and the endpoint at (1,1). This is why you define only the two control points in IXRKeySpline::SetControlPoint1 and IXRKeySpline::SetControlPoint2. The resulting curve specifies how an animation is interpolated during a time segment. That is, the curve represents the rate of change in the animation's target value.

A key spline that is a straight line from the starting point (0,0) to the endpoint (1,1) describes an animation with a constant rate of change. When each key frame in an animation has a different key spline, the rate of change during the animation is constantly shifting.

You can specify an IXRKeySpline object in IXRSplineDoubleKeyFrame::SetKeySpline, IXRSplineColorKeyFrame::SetKeySpline, and IXRSplinePointKeyFrame::SetKeySpline.

When you create a class instance, use an IXRKeySplinePtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define a key spline in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the KeySpline Class on MSDN.

.NET Framework Equivalent

System.Windows.Media.Animation.KeySpline

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Animation Storyboards
Classes for Visual Appearance