zoukankan      html  css  js  c++  java
  • 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曲线变化图:

  • 相关阅读:
    同步与异步 & 阻塞与非阻塞
    Memcached和Redis比较
    PHP安全之Web攻击
    搭建LNAMP环境(七)- PHP7源码安装Memcached和Memcache拓展
    PHP安装mysql.so扩展
    MySQL基础笔记
    CGI概念
    Nginx与Apache比较
    Nginx重写
    负载均衡session会话保持方法
  • 原文地址:https://www.cnblogs.com/Gyoung/p/3655464.html
Copyright © 2011-2022 走看看