IUIAnimationTransitionLibrary2::CreateAccelerateDecelerateTransition method (uianimation.h)

Creates an accelerate-decelerate scalar transition.

Syntax

HRESULT CreateAccelerateDecelerateTransition(
  [in]  UI_ANIMATION_SECONDS    duration,
  [in]  DOUBLE                  finalValue,
  [in]  DOUBLE                  accelerationRatio,
  [in]  DOUBLE                  decelerationRatio,
  [out] IUIAnimationTransition2 **transition
);

Parameters

[in] duration

The duration of the transition.

[in] finalValue

The value of the animation variable at the end of the transition.

[in] accelerationRatio

The ratio of duration time spent accelerating (0 to 1).

[in] decelerationRatio

The ratio of duration time spent decelerating (0 to 1).

[out] transition

The new accelerate-decelerate transition.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See Windows Animation Error Codes for a list of error codes.

Remarks

During an accelerate-decelerate transition, the animation variable speeds up and then slows down over the duration of the transition, ending at a specified value. You can control how quickly the variable accelerates and decelerates independently, by specifying different acceleration and deceleration ratios.

When the initial velocity is zero, the acceleration ratio is the fraction of the duration that the variable will spend accelerating; likewise for the deceleration ratio. If the value of initial velocity is nonzero, the value is the fraction of the time between the velocity reaching zero and the end of transition. The acceleration ratio and the deceleration ratio should sum to a maximum of 1.0.

The following figures show the change in value for animation variables with different initial velocities during accelerate-decelerate transitions.

Diagram showing accelerate-decelerate transitions
Note  d' in the figure on the right shows the time between the velocity reaching zero and the end of the transition.
 

Requirements

Requirement Value
Minimum supported client Windows 8, Windows 7 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server None supported
Target Platform Windows
Header uianimation.h
DLL UIAnimation.dll

See also

IUIAnimationTransition2

IUIAnimationTransitionLibrary2