CompositionAnimation
CompositionAnimation
CompositionAnimation
CompositionAnimation
Class
Definition
Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Prerelease APIs are identified by a Prerelease label.
[Contains prerelease APIs.]
Represents the base animation class.
public : class CompositionAnimation : CompositionObject, ICompositionAnimation, ICompositionAnimation2, ICompositionAnimation3, ICompositionAnimationBasepublic class CompositionAnimation : CompositionObject, ICompositionAnimation, ICompositionAnimation2, ICompositionAnimation3, ICompositionAnimationBasePublic Class CompositionAnimation Inherits CompositionObject Implements ICompositionAnimation, ICompositionAnimation2, ICompositionAnimation3, ICompositionAnimationBase// You can use this class in JavaScript.
- Inheritance
-
CompositionAnimationCompositionAnimationCompositionAnimationCompositionAnimation
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Remarks
This is the base class for ExpressionAnimation and KeyFrameAnimation.
Use the CompostionObject.StartAnimation and CompostionObject.StopAnimation methods to start and stop the animation.
Value parameters (as opposed to reference parameters which are set using SetReferenceParameter ) are copied and "embedded" into an expression at the time CompositionObject::StartAnimation is called. Changing the value of the variable after CompositionObject::StartAnimation is called will not affect the value of the ExpressionAnimation. See the remarks section of ExpressionAnimation for additional information.
Properties
InitialValueExpressions InitialValueExpressions InitialValueExpressions InitialValueExpressions
Prerelease. Gets the initial values for the animation.
public : InitialValueExpressionCollection InitialValueExpressions { get; }public InitialValueExpressionCollection InitialValueExpressions { get; }Public ReadOnly Property InitialValueExpressions As InitialValueExpressionCollection// You can use this property in JavaScript.
- Value
- InitialValueExpressionCollection InitialValueExpressionCollection InitialValueExpressionCollection InitialValueExpressionCollection
The initial values for the animation.
| Device family |
Windows 10 Insider Preview (introduced v10.0.16257.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v5)
|
Target Target Target Target
The target of the animation.
public : PlatForm::String Target { get; set; }public string Target { get; set; }Public ReadWrite Property Target As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The target of the animation.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
Methods
ClearAllParameters() ClearAllParameters() ClearAllParameters() ClearAllParameters()
Clears all of the parameters of the animation.
public : void ClearAllParameters()public void ClearAllParameters()Public Function ClearAllParameters() As void// You can use this method in JavaScript.
ClearParameter(String) ClearParameter(String) ClearParameter(String) ClearParameter(String)
Clears a parameter from the animation.
public : void ClearParameter(PlatForm::String key)public void ClearParameter(String key)Public Function ClearParameter(key As String) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The parameter to clear.
SetBooleanParameter(String, Boolean) SetBooleanParameter(String, Boolean) SetBooleanParameter(String, Boolean) SetBooleanParameter(String, Boolean)
Sets a boolean value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetBooleanParameter(PlatForm::String key, bool value)public void SetBooleanParameter(String key, Boolean value)Public Function SetBooleanParameter(key As String, value As Boolean) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
- value
- bool Boolean Boolean Boolean
The boolean value.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
SetColorParameter(String, Color) SetColorParameter(String, Color) SetColorParameter(String, Color) SetColorParameter(String, Color)
Sets a Color value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetColorParameter(PlatForm::String key, Color value)public void SetColorParameter(String key, Color value)Public Function SetColorParameter(key As String, value As Color) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
SetMatrix3x2Parameter(String, Matrix3x2) SetMatrix3x2Parameter(String, Matrix3x2) SetMatrix3x2Parameter(String, Matrix3x2) SetMatrix3x2Parameter(String, Matrix3x2)
Sets a Matrix3x2 value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetMatrix3x2Parameter(PlatForm::String key, Matrix3x2 value)public void SetMatrix3x2Parameter(String key, Matrix3x2 value)Public Function SetMatrix3x2Parameter(key As String, value As Matrix3x2) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
SetMatrix4x4Parameter(String, Matrix4x4) SetMatrix4x4Parameter(String, Matrix4x4) SetMatrix4x4Parameter(String, Matrix4x4) SetMatrix4x4Parameter(String, Matrix4x4)
Sets a Matrix4x4 value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetMatrix4x4Parameter(PlatForm::String key, Matrix4x4 value)public void SetMatrix4x4Parameter(String key, Matrix4x4 value)Public Function SetMatrix4x4Parameter(key As String, value As Matrix4x4) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
SetQuaternionParameter(String, Quaternion) SetQuaternionParameter(String, Quaternion) SetQuaternionParameter(String, Quaternion) SetQuaternionParameter(String, Quaternion)
Sets a Quaternion value for use with an ExpressionAnimation or an expression keyframe.
public : void SetQuaternionParameter(PlatForm::String key, Quaternion value)public void SetQuaternionParameter(String key, Quaternion value)Public Function SetQuaternionParameter(key As String, value As Quaternion) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
- value
- Quaternion Quaternion Quaternion Quaternion
The quaternion value.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
SetReferenceParameter(String, CompositionObject) SetReferenceParameter(String, CompositionObject) SetReferenceParameter(String, CompositionObject) SetReferenceParameter(String, CompositionObject)
Sets a reference to a Composition object for use with an ExpressionAnimation or an expression keyframe.
public : void SetReferenceParameter(PlatForm::String key, CompositionObject compositionObject)public void SetReferenceParameter(String key, CompositionObject compositionObject)Public Function SetReferenceParameter(key As String, compositionObject As CompositionObject) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set. The name can be used to reference the parameter in the ExpressionAnimation.
- compositionObject
- CompositionObject CompositionObject CompositionObject CompositionObject
The CompositionObject value.
Examples
The sample below outlines how to use an ExpressionAnimation to create a parallax effect between a background and foreground visual. This type of animation can be seen on the Windows Start Screen and Windows Phone Hub UIs.
void CreateParallaxExpression(Visual foreground, Visual background)
{
var animation = _compositor.CreateExpressionAnimation();
animation.Expression = "foreground.Offset * (foreground.Size / background.Size)";
animation.SetReferenceParameter("foreground", foreground);
animation.SetReferenceParameter("background", background);
background.StartAnimation("Offset", animation);
}
Remarks
By setting a reference to a CompositionObject, an ExpressionAnimation can refer to any animatable property on that CompositionObject. The CompositionObject 's current property value in the Compositor will be used when calculating the value of the expression. See the remarks section of ExpressionAnimation for additional information.
SetScalarParameter(String, Single) SetScalarParameter(String, Single) SetScalarParameter(String, Single) SetScalarParameter(String, Single)
Sets a Scalar value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetScalarParameter(PlatForm::String key, float value)public void SetScalarParameter(String key, Single value)Public Function SetScalarParameter(key As String, value As Single) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
- value
- float Single Single Single
The Single value.
SetVector2Parameter(String, Vector2) SetVector2Parameter(String, Vector2) SetVector2Parameter(String, Vector2) SetVector2Parameter(String, Vector2)
Sets a Vector2 value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetVector2Parameter(PlatForm::String key, Vector2 value)public void SetVector2Parameter(String key, Vector2 value)Public Function SetVector2Parameter(key As String, value As Vector2) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
SetVector3Parameter(String, Vector3) SetVector3Parameter(String, Vector3) SetVector3Parameter(String, Vector3) SetVector3Parameter(String, Vector3)
Sets a Vector3 value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetVector3Parameter(PlatForm::String key, Vector3 value)public void SetVector3Parameter(String key, Vector3 value)Public Function SetVector3Parameter(key As String, value As Vector3) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter to set.
SetVector4Parameter(String, Vector4) SetVector4Parameter(String, Vector4) SetVector4Parameter(String, Vector4) SetVector4Parameter(String, Vector4)
Sets a Vector4 value parameter for use with an ExpressionAnimation or an expression keyframe.
public : void SetVector4Parameter(PlatForm::String key, Vector4 value)public void SetVector4Parameter(String key, Vector4 value)Public Function SetVector4Parameter(key As String, value As Vector4) As void// You can use this method in JavaScript.
- key
- PlatForm::String String String String
The name of the parameter.