日期:2014-05-17 浏览次数:21007 次
<Storyboard x:Key="Move" RepeatBehavior="Forever" Timeline.DesiredFrameRate="30">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Car">
<EasingDoubleKeyFrame KeyTime="0" Value="起始点值"/>
<EasingDoubleKeyFrame KeyTime="0:0:15" Value="目标点值"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Window.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource Move}"/>
</EventTrigger>
</Window.Triggers>
<Image Name="Car" Stretch="Fill" Source="汽车图片路径">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>