Share via


CompositionObject.StartAnimation 메서드

정의

오버로드

StartAnimation(String, CompositionAnimation)

개체의 지정된 속성과 애니메이션을 연결하고 애니메이션을 시작합니다.

StartAnimation(String, CompositionAnimation, AnimationController)

개체의 지정된 속성과 애니메이션을 연결하고 애니메이션을 시작합니다.

StartAnimation(String, CompositionAnimation)

개체의 지정된 속성과 애니메이션을 연결하고 애니메이션을 시작합니다.

public:
 virtual void StartAnimation(Platform::String ^ propertyName, CompositionAnimation ^ animation) = StartAnimation;
void StartAnimation(winrt::hstring const& propertyName, CompositionAnimation const& animation);
public void StartAnimation(string propertyName, CompositionAnimation animation);
function startAnimation(propertyName, animation)
Public Sub StartAnimation (propertyName As String, animation As CompositionAnimation)

매개 변수

propertyName
String

Platform::String

winrt::hstring

애니메이션을 연결할 속성입니다.

animation
CompositionAnimation

지정된 속성과 연결할 애니메이션입니다.

예제

void AnimatingVisualOffset(Visual targetVisual) 
{ 
    var animation = _compositor.CreateVector3KeyFrameAnimation(); 

    // 
    // Define specific easing functions. 
    // 


    var linear = _compositor.CreateLinearEasingFunction(); 

    var easeIn = _compositor.CreateCubicBezierEasingFunction( 
            new Vector2(0.5f, 0.0f), new Vector2(1.0f, 1.0f)); 

    var easeOut = _compositor.CreateCubicBezierEasingFunction( 
            new Vector2(0.0f, 0.0f), new Vector2(0.5f, 1.0f)); 

    // 
    // Add a set of key frames to describe how the Offset should change over time.   
    // 

    animation.InsertKeyFrame(0.00f, new Vector3(100.0f, 100.0f, 0.0f)); 
    animation.InsertKeyFrame(0.25f, new Vector3(300.0f, 100.0f, 0.0f), easeIn); 
    animation.InsertKeyFrame(0.50f, new Vector3(300.0f, 300.0f, 0.0f), linear); 
    animation.InsertKeyFrame(0.75f, new Vector3(100.0f, 300.0f, 0.0f), linear); 
    animation.InsertKeyFrame(1.00f, new Vector3(100.0f, 100.0f, 0.0f), easeOut); 

    // 
    // The animation curve defined by the key frames will scale to match the duration. 
    // 

    animation.Duration = TimeSpan.FromMilliseconds(4000); 

    targetVisual.StartAnimation("Offset", animation); 
}     

설명

StartAnimation이 호출될 때 애니메이션이 개체의 속성에 이미 바인딩된 경우 이전에 적용된 애니메이션의 연결이 끊어지고 새 애니메이션이 할당됩니다. 마찬가지로 속성을 직접 설정하면 이전 애니메이션의 연결이 끊어지고 새 속성 값이 적용됩니다.

다음 표에서는 애니메이션 효과를 주는 속성의 목록을 보여줍니다.

개체 속성 이름 속성 유형
시각적 개체 AnchorPoint Vector2
--- CenterPoint Vector3
--- Offset Vector3
--- 불투명도 스칼라
--- 방향 Vector4
--- RotationAngle 스칼라
--- RotationAxis Vector3
--- 크기 Vector2
--- TransformMatrix Matrix4x4
InsetClip BottomInset 스칼라
--- LeftInset 스칼라
--- RightInset 스칼라
--- TopInset 스칼라
CompositionColorBrush 색상 Windows.UI.Color
CompositionPropertySet 개발자가 지정한 속성 집합입니다.

또한 CompositionEffectBrush 개체 아래의 일부 효과 속성에 애니메이션 효과를 줄 수 있습니다.

효과 이름 속성 이름 속성 유형
SaturationEffect 채도 스칼라
ColorSourceEffect 색상 Vector4
ArithmeticComposite Offset 스칼라
--- Source1Amount 스칼라
--- Source2Amount 스칼라
--- MultiplyAmount 스칼라
Transform2D TransformMatrix Matrix3x2
ContrastEffect 이 예와 Float
ExposureEffect 노출 Float
HueRotationEffect 각도 Float
SepiaEffect 강도 Float
TemperatureAndTintEffect 온도 Float
--- 색조 Float
GammaTransferEffect RedAmplitude Float
--- RedExponent Float
--- RedOffset Float
--- GreenAmplitude Float
--- GreenExponent Float
--- GreenOffset Float
--- BlueAmplitude Float
--- BlueExponent Float
--- BlueOffset Float
--- AlphaAmplitude Float
--- AlphaExponent Float
--- AlphaOffset Float

적용 대상

StartAnimation(String, CompositionAnimation, AnimationController)

개체의 지정된 속성과 애니메이션을 연결하고 애니메이션을 시작합니다.

public:
 virtual void StartAnimation(Platform::String ^ propertyName, CompositionAnimation ^ animation, AnimationController ^ animationController) = StartAnimation;
/// [Windows.Foundation.Metadata.Overload("StartAnimationWithController")]
void StartAnimation(winrt::hstring const& propertyName, CompositionAnimation const& animation, AnimationController const& animationController);
[Windows.Foundation.Metadata.Overload("StartAnimationWithController")]
public void StartAnimation(string propertyName, CompositionAnimation animation, AnimationController animationController);
function startAnimation(propertyName, animation, animationController)
Public Sub StartAnimation (propertyName As String, animation As CompositionAnimation, animationController As AnimationController)

매개 변수

propertyName
String

Platform::String

winrt::hstring

애니메이션을 연결할 속성입니다.

animation
CompositionAnimation

지정된 속성과 연결할 애니메이션입니다.

animationController
AnimationController

애니메이션과 연결할 애니메이션 컨트롤러입니다.

특성

설명

매개 변수를 animationController 사용하면 여러 애니메이션을 단일 컨트롤러의 Progress 속성에 바인딩할 수 있습니다. 이 속성은 여러 애니메이터의 Progress 속성을 CompositionObject 속성에 바인딩하는 것보다 ExpressionAnimation 개체가 더 적습니다.

적용 대상