CAnimationColor 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 CAnimationColor Class.
Implements the functionality of a color whose red, green, and blue components can be animated.
class CAnimationColor : public CAnimationBaseObject;
Name | Description |
---|---|
CAnimationColor::CAnimationColor | Overloaded. Constructs an animation color object. |
Name | Description |
---|---|
CAnimationColor::AddTransition | Adds transitions for Red, Green and Blue components. |
CAnimationColor::GetB | Provides access to CAnimationVariable representing Blue component. |
CAnimationColor::GetDefaultValue | Returns the default values for color components. |
CAnimationColor::GetG | Provides access to CAnimationVariable representing Green component. |
CAnimationColor::GetR | Provides access to CAnimationVariable representing Red component. |
CAnimationColor::GetValue | Returns current value. |
CAnimationColor::SetDefaultValue | Sets default value. |
Name | Description |
---|---|
CAnimationColor::GetAnimationVariableList | Puts the encapsulated animation variables into a list. (Overrides CAnimationBaseObject::GetAnimationVariableList.) |
Name | Description |
---|---|
CAnimationColor::operator COLORREF | |
CAnimationColor::operator= | Assigns color to CAnimationColor. |
Name | Description |
---|---|
CAnimationColor::m_bValue | The encapsulated animation variable that represents Blue component of animation color. |
CAnimationColor::m_gValue | The encapsulated animation variable that represents Green component of animation color. |
CAnimationColor::m_rValue | The encapsulated animation variable that represents Red component of animation color. |
The CAnimationColor class encapsulates three CAnimationVariable objects and can represent in applications a color. For example, you can use this class to animate colors of any object on the screen (like text color, background color etc). To use this class in application, just instantiate an object of this class, add it to animation controller using CAnimationController::AddAnimationObject and call AddTransition for each transition to be applied to Red, Green and Blue components.
Header: afxanimationcontroller.h
Adds transitions for Red, Green and Blue components.
void AddTransition(
CBaseTransition* pRTransition,
CBaseTransition* pGTransition,
CBaseTransition* pBTransition);
pRTransition
Transition for Red component.
pGTransition
Transition for Green component.
pBTransition
Transition for Blue component.
Call this function to add the specified transitions to the internal list of transitions to be applied to animation variables representing color components. When you add transitions, they are not applied immediately and stored in an internal list. Transitions are applied (added to a storyboard for a particular value) when you call CAnimationController::AnimateGroup. If you don't need to apply a transition to one of the color components, you can pass NULL.
Constructs a CAnimationColor object.
CAnimationColor();
CAnimationColor(
COLORREF color,
UINT32 nGroupID,
UINT32 nObjectID = (UINT32)-1,
DWORD dwUserData = 0);
color
Specifies default color.
nGroupID
Specifies Group ID.
nObjectID
Specifies Object ID.
dwUserData
Specifies user-defined data.
The object is constructed with default values for red, green, blue, Object ID and Group ID, which will be set to 0. They can be changed later at runtime using SetDefaultValue and SetID.
Puts the encapsulated animation variables into a list.
virtual void GetAnimationVariableList(CList<CAnimationVariable*, CAnimationVariable*>& lst);
lst
When the function returns, it contains pointers to three CAnimationVariable objects representing red, green and blue components.
Provides access to CAnimationVariable representing Blue component.
CAnimationVariable& GetB();
A reference to encapsulated CAnimationVariable representing Blue component.
You can call this method to get direct access to underlying CAnimationVariable representing Blue component.
Returns the default values for color components.
COLORREF GetDefaultValue();
A COLORREF value containing defaults for RGB components.
Call this function to retrieve default value, which was previously set by constructor or SetDefaultValue.
Provides access to CAnimationVariable representing Green component.
CAnimationVariable& GetG();
A reference to encapsulated CAnimationVariable representing Green component.
You can call this method to get direct access to underlying CAnimationVariable representing Green component.
Provides access to CAnimationVariable representing Red component.
CAnimationVariable& GetR();
A reference to encapsulated CAnimationVariable representing Red component.
You can call this method to get direct access to underlying CAnimationVariable representing Red component.
Returns current value.
BOOL GetValue(COLORREF& color);
color
Output. Contains the current value when this method returns.
TRUE, if the current value was successfully retrieved; otherwise FALSE.
Call this function to retrieve the current value of animation color. If this method fails or underlying COM objects for color components have not been initialized, color contains default value, which was previously set in constructor or by SetDefaultValue.
The encapsulated animation variable that represents Blue component of animation color.
CAnimationVariable m_bValue;
The encapsulated animation variable that represents Green component of animation color.
CAnimationVariable m_gValue;
The encapsulated animation variable that represents Red component of animation color.
CAnimationVariable m_rValue;
operator COLORREF();
Assigns color to CAnimationColor.
void operator=(COLORREF color);
color
Specifies new value Animation Color.
It's recommended to do that before animation start, because this operator calls SetDefaultValue, which recreates the underlying COM objects for color components if they have been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), you need to re-enable these events.
Sets default value.
void SetDefaultValue(COLORREF color);
color
Specifies new default values for red, green and blue components.
Use this function to set a default value to animation object. This methods assigns default values to color components of animation color. It also recreates underlying COM objects if they have been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), you need to re-enable these events.