CKeyFrame Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CKeyFrame Class.

Represents an animation keyframe.

class CKeyFrame : public CBaseKeyFrame;  

Public Constructors

NameDescription
CKeyFrame::CKeyFrameOverloaded. Constructs a keyframe that depends on other keyframe.

Public Methods

NameDescription
CKeyFrame::AddToStoryboardAdds a keyframe to a storyboard. (Overrides CBaseKeyFrame::AddToStoryboard.)
CKeyFrame::AddToStoryboardAfterTransitionAdds a keyframe to storyboard after transition.
CKeyFrame::AddToStoryboardAtOffsetAdds a keyframe to storyboard at offset.
CKeyFrame::GetExistingKeyframeReturns a pointer to a keyframe this keyframe depends on.
CKeyFrame::GetOffsetReturns an offset from other keyframe.
CKeyFrame::GetTransitionReturns a pointer to a transition this keyframe depends on.

Protected Data Members

NameDescription
CKeyFrame::m_offsetSpecifies offset of this keyframe from a keyframe stored in m_pExistingKeyFrame.
CKeyFrame::m_pExistingKeyFrameStores a pointer to an existing keframe. This keyframe is added to storyboard with m_offset to the existing keyframe.
CKeyFrame::m_pTransitionStores a pointer to transtion that begins at this keyframe.

This class implements an animation keyframe. A keyframe represents a moment in time within a storyboard and can be used to specify the start and end times of transitions. A keyframe may be based on other keyframe and have an offset (in seconds) from it, or may be based on a transition and represent a moment in time when this transition ends.

CObject

CBaseKeyFrame

CKeyFrame

Header: afxanimationcontroller.h

Adds a keyframe to a storyboard.

virtual BOOL AddToStoryboard(
    IUIAnimationStoryboard* pStoryboard,  
    BOOL bDeepAdd);

Parameters

pStoryboard
A pointer to a storyboard.

bDeepAdd
Specifies whether to add keyframe or transition recursively.

Return Value

TRUE, if keyframe was added successfully.

Remarks

This method adds a keyframe to storyboard. If it depends on other keyframe or transition and bDeepAdd is TRUE, this method tries to add them recursively.

Adds a keyframe to storyboard after transition.

BOOL AddToStoryboardAfterTransition(
    IUIAnimationStoryboard* pStoryboard,  
    BOOL bDeepAdd);

Parameters

pStoryboard
A pointer to a storyboard.

bDeepAdd
Specifies whether to add a transition recursively.

Return Value

TRUE, if keyframe was added successfully.

Remarks

This function is called by the framework to add a keyframe to storyboard after transition.

Adds a keyframe to storyboard at offset.

virtual BOOL AddToStoryboardAtOffset(
    IUIAnimationStoryboard* pStoryboard,  
    BOOL bDeepAdd);

Parameters

pStoryboard
A pointer to a storyboard.

bDeepAdd
Specifies whether to add a keyframe this keyframe depend on recursively.

Return Value

TRUE, if keyframe was added successfully.

Remarks

This function is called by the framework to add a keyframe to storyboard at offset.

Constructs a keyframe that depends on a transition.

CKeyFrame(CBaseTransition* pTransition);

 
CKeyFrame(
    CBaseKeyFrame* pKeyframe,  
    UI_ANIMATION_SECONDS offset = 0.0);

Parameters

pTransition
A pointer to a transition.

pKeyframe
A pointer to keyframe.

offset
Offset, in seconds, from keyframe specified by pKeyframe.

Remarks

The constructed keyframe will represent a moment in time within a storyboard when the specified transition ends.

Returns a pointer to a keyframe this keyframe depends on.

CBaseKeyFrame* GetExistingKeyframe();

Return Value

A valid pointer to keyframe, or NULL if this keyframe does not depend on other keyframe.

Remarks

This is an accessor to a keyframe this keyframe depends on.

Returns an offset from other keyframe.

UI_ANIMATION_SECONDS GetOffset();

Return Value

An offset in seconds from other keyframe.

Remarks

This method should be called to determine an offset in seconds from other keyframe.

Returns a pointer to a transition this keyframe depends on.

CBaseTransition* GetTransition();

Return Value

A valid pointer to transition, or NULL if this keyframe does not depend on transition.

Remarks

This is an accessor to a transition this keyframe depends on.

Specifies offset of this keyframe from a keyframe stored in m_pExistingKeyFrame.

UI_ANIMATION_SECONDS m_offset;  

Stores a pointer to an existing keframe. This keyframe is added to storyboard with m_offset to the existing keyframe.

CBaseKeyFrame* m_pExistingKeyFrame;  

Stores a pointer to transtion that begins at this keyframe.

CBaseTransition* m_pTransition;  

Classes

Show: