IDCompositionAnimation::End method

Adds an end segment that marks the end of an animation function.


  double endOffset,
  float  endValue



Type: double

The offset, in seconds, from the beginning of the animation function to the point when the function ends.


Type: float

The final value of the animation.

Return Value


If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See DirectComposition Error Codes for a list of error codes.


When the specified offset is reached, the property or properties affected by this animation are set to the specified final value, and then the animation stops. If no end segment is added, the final segment of the animation function runs indefinitely. Calling this method is semantically identical to making the last segment of the animation function a cubic polynomial where the cubic, quadratic, and linear coefficients are all zeros, and the constant coefficient is the desired final value.

Because animation segments must be added in increasing order, this method fails if the endOffset parameter is less than or equal to the beginOffset parameter of the previous segment. This method also fails if this is the first segment to be added to the animation function.

After this method is called, all methods on this animation object fail except the IDCompositionAnimation::Reset method.


Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header dcompanimation.h
Library Dcomp.lib
DLL Dcomp.dll

See Also