Partager via


IXRPowerEase (Compact 2013)

3/28/2014

This class includes an easing method that helps create animations that accelerate or decelerate using the formula f(t) = tp where p is equal to the Power property.

Syntax

class IXRPowerEase : public IXREasingFunctionBase

Inheritance Hierarchy

IXRDependencyObject

    IXREasingFunctionBase

        IXRPowerEase

Methods

In addition to the methods inherited from IXREasingFunctionBase, this class contains the following methods.

Method

Description

IXRPowerEase::GetPower

Retrieves the exponential power of the animation interpolation.

IXRPowerEase::SetPower

Sets the exponential power of the animation interpolation. For example, a value of 7 creates an animation interpolation curve that follows the formula f(t) = t7.

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 control whether the animation accelerates, decelerates, or both, by passing one of the XREasingMode enumerated values to the inherited IXREasingFunctionBase::SetEasingMode method. The following graphs demonstrate the different values of the easing mode, where f(t) represents the animation progress and t represents time. In these illustrations, the Power property is set to 4.

Easing function

XREasingMode_EaseIn

XREasingMode_EaseOut

XREasingMode_EaseInOut

IXRPowerEase

Gg155489.729ddf04-2f30-437d-bbe4-f3aa44c9ef74(en-us,WinEmbedded.80).jpg
Gg155489.1381fe2e-4c07-4c98-bd7c-8bc04c0510ed(en-us,WinEmbedded.80).jpg
Gg155489.7d702ca2-e1f9-4c08-be4b-b956f6554063(en-us,WinEmbedded.80).jpg

The IXRPowerEase function can be substituted for IXRQuadraticEase, IXRCubicEase, IXRQuarticEase, and IXRQuinticEase. For example, if you wanted to use a IXRPowerEase function to create the same behavior as a IXRQuadraticEase function (f(t) = t2), use the IXRPowerEase::SetPower method to specify a Power property value of 2.

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

You can apply this easing function to an animation 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 PowerEase Class on MSDN.

There are several other easing functions besides IXRPowerEase that you can explore using the following sample:

Run the sample

.NET Framework Equivalent

System.Windows.Media.Animation.PowerEase

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Animation Storyboards
IXREasingFunctionBase::SetEasingMode