Blog Content

    티스토리 뷰

    75.SilverLight3 - SplineKeyFrame

    반응형
    SplineKeyFrame
    - 비 선형 애니메이션을 실행, 애니메이션의 속도 조절


    MainPage.xaml

    [그림 75-1]


    <Canvas x:Name="LayoutRoot" Background="White">

        <Canvas.Resources>

            <Storyboard x:Name="mySb">

                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="myRect"

                    Storyboard.TargetProperty="(Canvas.Top)">

                    <DoubleAnimationUsingKeyFrames.KeyFrames>

                        <SplineDoubleKeyFrame KeyTime="0:0:5" Value="110"

                            KeySpline="0.0,1.0,1.0,1.0"></SplineDoubleKeyFrame>

                       

                        <SplineDoubleKeyFrame KeyTime="0:0:5" Value="220"

                            KeySpline="1.0,0.0,1.0,1.0"></SplineDoubleKeyFrame>

                        </DoubleAnimationUsingKeyFrames.KeyFrames>

                    </DoubleAnimationUsingKeyFrames>

            </Storyboard>

        </Canvas.Resources>

        <Rectangle x:Name="myRect" Width="50" Height="50" Canvas.Left="10"

            Canvas.Top="10" Fill="DodgerBlue"></Rectangle>

    </Canvas>


    MainPage.xaml.cs

    public partial class MainPage : UserControl

    {

        public MainPage()

        {

            InitializeComponent();

            this.Loaded += new RoutedEventHandler(MainPage_Loaded);

        }

     

        void MainPage_Loaded(object sender, RoutedEventArgs e)

        {

            this.mySb.Begin();

        }

    }


    결과화면

    [그림 75-2]



    반응형

    'Silverlight' 카테고리의 다른 글

    77.SilverLight3 - Trigger [개발자]  (0) 2009.12.07
    76.SilverLight3 - EasingKeyFrame  (0) 2009.12.04
    74.SilverLight3 - DiscreteKeyFrame  (0) 2009.12.04
    73.SilverLight3 - LinearKeyFrame  (0) 2009.12.04
    72.SilverLight3 - TimeLine  (0) 2009.12.03

    Comments