IUIAnimationStoryboard::AddKeyframeAtOffset method (uianimation.h)
Adds a keyframe at the specified offset from an existing keyframe.
Syntax
HRESULT AddKeyframeAtOffset(
[in] UI_ANIMATION_KEYFRAME existingKeyframe,
[in] UI_ANIMATION_SECONDS offset,
[out] UI_ANIMATION_KEYFRAME *keyframe
);
Parameters
[in] existingKeyframe
The existing keyframe. To add a keyframe at an offset from the start of the storyboard, use the special keyframe UI_ANIMATION_KEYFRAME_STORYBOARD_START.
[in] offset
The offset from the existing keyframe at which a new keyframe is to be added.
[out] keyframe
The keyframe to be added.
Return value
If the 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
A keyframe represents a moment in time within a storyboard and can be used to specify the start and 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.
Examples
The following code adds a keyframe at a fixed offset of 0.3 seconds from the keyframe at the start of the storyboard.
const UI_ANIMATION_SECONDS offset = 0.3;
UI_ANIMATION_KEYFRAME keyframe1;
hr = pStoryboard->AddKeyframeAtOffset(
UI_ANIMATION_KEYFRAME_STORYBOARD_START,
offset,
&keyframe1
);
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7, Windows Vista and Platform Update for Windows Vista [desktop apps | UWP apps] |
Minimum supported server | None supported |
Target Platform | Windows |
Header | uianimation.h |
DLL | UIAnimation.dll |
See also
IUIAnimationStoryboard::AddKeyframeAfterTransition
IUIAnimationStoryboard::AddTransitionAtKeyframe