IUIAnimationStoryboard2::RepeatBetweenKeyframes method (uianimation.h)

Creates a loop between two keyframes.

Syntax

HRESULT RepeatBetweenKeyframes(
  [in] UI_ANIMATION_KEYFRAME                   startKeyframe,
  [in] UI_ANIMATION_KEYFRAME                   endKeyframe,
  [in] DOUBLE                                  cRepetition,
  [in] UI_ANIMATION_REPEAT_MODE                repeatMode,
  [in] IUIAnimationLoopIterationChangeHandler2 *pIterationChangeHandler,
  [in] UINT_PTR                                id,
  [in] BOOL                                    fRegisterForNextAnimationEvent
);

Parameters

[in] startKeyframe

The keyframe at which the loop is to begin.

[in] endKeyframe

The keyframe at which the loop is to end. endKeyframe must not occur earlier in the storyboard than startKeyframe.

[in] cRepetition

The number of times the loop is to be repeated; the last iteration of a loop can terminate fractionally between keyframes. A value of zero indicates that the specified portion of a storyboard will not be played. A value of UI_ANIMATION_REPEAT_INDEFINITELY (-1) indicates that the loop will repeat indefinitely until the storyboard is trimmed or concluded.

[in] repeatMode

The pattern for the loop iteration.

A value of UI_ANIMATION_REPEAT_MODE_ALTERNATE (1) specifies that the start of the loop must alternate between keyframes (k1->k2, k2->k1, k1->k2, and so on).

A value of UI_ANIMATION_REPEAT_MODE_NORMAL (0) specifies that the start of the loop must begin with the first keyframe (k1->k2, k1->k2, k1->k2, and so on).

Note  If repeatMode has a value of UI_ANIMATION_REPEAT_MODE_ALTERNATE (1) and cRepetition has a value of UI_ANIMATION_REPEAT_INDEFINITELY (-1), the loop terminates on the end keyframe.
 

[in] pIterationChangeHandler

The handler for each loop iteration event. The default value is 0.

[in] id

The loop ID to pass to pIterationChangeHandler. The default value is 0.

[in] fRegisterForNextAnimationEvent

If true, specifies that pIterationChangeHandler will be incorporated into the estimate of the time interval until the next animation event that is returned by the IUIAnimationManager2::EstimateNextEventTime method. The default value is 0, or false.

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

This method directs a storyboard to play the interval between the given keyframes repeatedly before playing the remainder of the storyboard. If a finite repetition count is specified, the loop always plays that number of times. If UI_ANIMATION_REPEAT_INDEFINITELY (-1) is specified, the loop repeats until the storyboard is concluded, in which case the current iteration of the loop completes and the remainder of the storyboard plays. A storyboard that loops indefinitely also ends if it is truncated.

Nested and overlapping loops are not supported.

A keyframe represents a moment in time within a storyboard and can be used to specify the start or end times of transitions. Because keyframes can be added at the ends of transitions, their offsets from the start of the storyboard may not be known until the storyboard is playing.

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

IUIAnimationStoryboard2

IUIAnimationStoryboard2::AddKeyframeAfterTransition

IUIAnimationStoryboard2::AddKeyframeAtOffset