Partager via


IXRColorAnimation::SetFrom (Compact 2013)

3/28/2014

This method sets the starting value of the animation.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetFrom(
    __in COLORREF From
) = 0;

Parameters

  • From
    [in] The COLORREF value that indicates the starting value of the animation.

Return Value

Returns an HRESULT that returns S_OK if successful; otherwise, returns a non-zero error code.

Remarks

You can use the RGB macro or the RGBA macro to create a color value to supply to this method.

The following table summarizes how you can use the SetFrom, SetTo, and SetBy methods together or separately to determine the target values of an animation.

Method(s)

Result

SetFrom

The animation progresses from the value specified in SetFrom to the base value of the property being animated.

SetFrom and SetTo

The animation progresses from the value specified in SetFrom to the value specified in SetTo.

SetFrom and SetBy

The animation progresses from the value specified in SetFrom to the sum of the values specified in SetFrom and SetBy.

SetTo

The animation progresses from the animated property base value or a previous animation output value to the value specified in SetTo.

SetBy

The animation progresses from the animated property base value or a previous animation output value to the sum of that value and the value specified in SetBy.

If you use both the SetTo and SetBy methods, the value specified in SetTo takes precedence and the SetBy property is ignored.

To use other interpolation methods or to define an animation that progresses through more than two target values, use the IXRColorAnimationUsingKeyFrames object.

.NET Framework Equivalent

System.Windows.Media.Animation.ColorAnimation.From

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRColorAnimation
IXRColorAnimation::GetFrom