.Net Project/SilverLight 3.0

62장 에니메이션 TimeLine (SpeedRatio)

Magic_kit 2009. 12. 7. 18:22
반응형
  SpeedRatio
- 애니메이션의 재생 속도를 결정 하기 위하여 사용
  SpeedRatio.Xamls

<UserControl x:Class="AnimationExample.MainPage"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">

    <Canvas x:Name="LayoutRoot">

        <Canvas.Resources>

 

       <!-- 사각형을 이동시키는 좌표 이동 -->

            <Storyboard x:Name="rectAnimation">

 

                <!-- Y 좌표 이동 애니 메이션 -->

                <DoubleAnimation

                    SpeedRatio="0.5"

                    Duration="00:00:01"

                    Storyboard.TargetName="rect"

                    Storyboard.TargetProperty="(Canvas.Top)"

                        From="0" To="100"/>

 

                <!-- X 좌표 이동 애니메이션 -->

                <DoubleAnimation

                    SpeedRatio="0.5"

                    Duration="00:00:01"

                    Storyboard.TargetName="rect"

                    Storyboard.TargetProperty="(Canvas.Left)"

                        From="0" To="100"/>

 

            </Storyboard>

        </Canvas.Resources>

 

        <!-- 사각형 -->

        <Rectangle x:Name="rect" Fill="Red"

                   Width="100" Height="100"

                   Canvas.Left="0" Canvas.Top="0"/>

    </Canvas>

</UserControl> 




반응형