WPF 翻转动画实现(转)

这个动画本来很简单的,从论坛上看到了,就放在这里,省的以后做了

[csharp] view plaincopyprint?

  1. <Window x:Class="WPFTransformWindows.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="MainWindow" Height="350" Width="525" Foreground="{x:Null}" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="{x:Null}" Topmost="True">
  5. <Window.Resources>
  6. <Storyboard x:Key="fanzhuan">
  7. <PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="grid">
  8. <EasingPointKeyFrame KeyTime="0" Value="0.5,0.5"/>
  9. </PointAnimationUsingKeyFrames>
  10. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="grid">
  11. <EasingDoubleKeyFrame KeyTime="0" Value="-1">
  12. <EasingDoubleKeyFrame.EasingFunction>
  13. <CubicEase EasingMode="EaseOut"/>
  14. </EasingDoubleKeyFrame.EasingFunction>
  15. </EasingDoubleKeyFrame>
  16. <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1">
  17. <EasingDoubleKeyFrame.EasingFunction>
  18. <CubicEase EasingMode="EaseOut"/>
  19. </EasingDoubleKeyFrame.EasingFunction>
  20. </EasingDoubleKeyFrame>
  21. </DoubleAnimationUsingKeyFrames>
  22. </Storyboard>
  23. </Window.Resources>
  24. <Window.Triggers>
  25. <EventTrigger RoutedEvent="FrameworkElement.Loaded">
  26. <BeginStoryboard Storyboard="{StaticResource fanzhuan}"/>
  27. </EventTrigger>
  28. </Window.Triggers>
  29. <Grid x:Name="grid" MouseLeftButtonDown="grid_MouseLeftButtonDown_1">
  30. <Grid.RenderTransform>
  31. <TransformGroup>
  32. <ScaleTransform/>
  33. <SkewTransform/>
  34. <RotateTransform/>
  35. <TranslateTransform/>
  36. </TransformGroup>
  37. </Grid.RenderTransform>
  38. <Grid.Background>
  39. <ImageBrush ImageSource="6.jpg" Stretch="UniformToFill"/>
  40. </Grid.Background>

转载于:https://www.cnblogs.com/aoldman/archive/2012/11/19/2777549.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值