次の方法で共有


IXRTimeline::SetSpeedRatio (Compact 2013)

3/28/2014

This method sets the rate, in relation to its parent, at which time progresses for this timeline.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetSpeedRatio(
    float SpeedRatio
) = 0;

Parameters

  • SpeedRatio
    [in] a float value greater than 0 that specifies the new rate at which time progresses for this timeline, relative to the speed of its parent.

    If this timeline is a root timeline in the visual tree, this value specifies the default timeline speed. The value is expressed as a factor where 1 represents regular speed, 2 is double speed, 0.5 is half-rate speed, and so on.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

The speed ratio of a timeline does not affect when it begins playing. For child timelines, the begin time is relative to the animation properties of its parent timeline. For more information on how to set when the timelines begins, see IXRTimeline::SetBeginTime.

You can apply momentary or variable speed changes to animations by using spline animations. With a spline animation, you can define a rate of speed during the animation that is constantly shifting.

If you animate with splined interpolation using spline key frames, you can achieve more realistic and fine-tuned timing effects, such as the acceleration and deceleration of objects. For more information, see IXRDoubleAnimationUsingKeyFrames.

.NET Framework Equivalent

System.Windows.Media.Animation.Timeline.SpeedRatio

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRTimeline
IXRTimeline::GetSpeedRatio