Blog Content

    티스토리 뷰

    73.SilverLight3 - LinearKeyFrame

    반응형
    LinearKeyFrame
    - 선형 애니메이션을 실행, 속성값이 초기값으로 연속적으로 변경

    MainPage.xaml

    [그림 73-1]


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

        <!-- -->

        <Canvas.Resources>

            <Storyboard x:Name="mySb">

                <ColorAnimationUsingKeyFrames

                    Storyboard.TargetName="myRect"

                    Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"

                    Duration="0:0:3">

                    <ColorAnimationUsingKeyFrames.KeyFrames>

                        <LinearColorKeyFrame KeyTime="0:0:0" Value="Red">

                        </LinearColorKeyFrame>

                        <LinearColorKeyFrame KeyTime="0:0:1" Value="Blue">

                        </LinearColorKeyFrame>

                        <LinearColorKeyFrame KeyTime="0:0:2" Value="Green">

                        </LinearColorKeyFrame>

                        <LinearColorKeyFrame KeyTime="0:0:3" Value="Yellow">

                        </LinearColorKeyFrame>

                    </ColorAnimationUsingKeyFrames.KeyFrames>

                </ColorAnimationUsingKeyFrames>

            </Storyboard>

        </Canvas.Resources>

        <!---->

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

                   Fill="Red"></Rectangle>

    </Canvas>


    결과화면

    [그림 73-2]



    반응형

    'Silverlight' 카테고리의 다른 글

    75.SilverLight3 - SplineKeyFrame  (0) 2009.12.04
    74.SilverLight3 - DiscreteKeyFrame  (0) 2009.12.04
    72.SilverLight3 - TimeLine  (0) 2009.12.03
    71.SilverLight3 - ColorAnimation  (0) 2009.12.03
    70.SilverLight3 - PointAnimation  (0) 2009.12.03

    Comments