• Silverlight动画之 Animation Easing


    使用Animation Easing函数可以创造出更具有动感的动画。对比下面两个动画。

    普通线性动画:

    <Storyboard x:Name="growStoryboard">
    <DoubleAnimation
    Storyboard.TargetName="cmdGrow" Storyboard.TargetProperty="Width"
    To="400" Duration="0:0:1.5"></DoubleAnimation>
    </Storyboard>

    使用Easing Function:

    <Storyboard x:Name="growStoryboard">
    <DoubleAnimation
    Storyboard.TargetName="cmdGrow" Storyboard.TargetProperty="Width"
    To="400" Duration="0:0:1.5">
    <DoubleAnimation.EasingFunction>
    <ElasticEase EasingMode="EaseOut" Oscillations="5"></ElasticEase>
    </DoubleAnimation.EasingFunction>
    </DoubleAnimation>
    </Storyboard>

    通过VS写下这段代码并运行,你就知道加了Easing Function后与之前的显著差别。使用Easing Function,可以让我们很简单的创建效果复杂的动画。

    每一个Easing Function都继承自EasingFunctionBase并实现EasingMode。EasingMode有三个值:EaseIn,EaseOut和EaseInOut。

    EaseOut变化曲线图:

    EaseIn变化曲线图:

    Silverlight提供了11种easing functions

    • BackEase
    • ElasticEase
    • BounceEase
    • CircleEase
    • CubicEase
    • QuadraticEase
    • QuarticEase
    • QuinticEase
    • SineEase
    • PowerEase
    • ExponentialEase

     下图是六种比较常用的easing functions曲线变化图:

  • 相关阅读:
    学习视频收集
    vscode 编译器插件
    vue2.0父子组件之间传值
    js 案例
    插件
    【转】30分钟掌握 C#6
    【初码干货】关于.NET玩爬虫这些事
    上机作业七 系统进程与计划任务管理
    客户端与服务器双向密钥对验证
    DHCP中继配置
  • 原文地址:https://www.cnblogs.com/Gyoung/p/3655464.html
Copyright © 2020-2023  润新知