zoukankan      html  css  js  c++  java
  • wp7 动画

    <Rectangle Width="100" Height="100" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="Red" Name="darkMoon"/>           

        DoubleAnimationUsingKeyFrames doublea = new DoubleAnimationUsingKeyFrames()
                {
                    BeginTime = new TimeSpan(0, 0, 0, 2),
                    SpeedRatio=1,
                    Duration = new Duration(TimeSpan.FromSeconds(1)),
                    AutoReverse = false,
                    RepeatBehavior = new RepeatBehavior(20),
                    FillBehavior = FillBehavior.HoldEnd
                };
                EasingDoubleKeyFrame key1 = new EasingDoubleKeyFrame()
                {
                    KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0)),
                    Value = 0
                };
                EasingDoubleKeyFrame key2 = new EasingDoubleKeyFrame()
                {
                    KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(1)),
                    Value = 100
                };
                EasingDoubleKeyFrame key3 = new EasingDoubleKeyFrame()
                {
                    KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2)),
                    Value = 200
                };
                EasingDoubleKeyFrame key4 = new EasingDoubleKeyFrame()
                {
                    KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(3)),
                    Value = 300
                };
                doublea.KeyFrames.Add(key1);
                doublea.KeyFrames.Add(key2);
                doublea.KeyFrames.Add(key3);
                doublea.KeyFrames.Add(key4);

                Storyboard storyboard2 = new Storyboard();
                Storyboard.SetTarget(doublea, darkMoon);
                Storyboard.SetTargetProperty(doublea, new PropertyPath(WidthProperty));
                storyboard2.Children.Add(doublea);
                storyboard2.Begin();

    ////////////////////////////////////////////////////////////////////////////////////////////////////////

                DoubleAnimation doublea = new DoubleAnimation()
                {
                    BeginTime = new TimeSpan(0, 0, 0, 2),
                    From = 200,
                    To = 300,
                    Duration = new Duration(TimeSpan.FromSeconds(1)),
                    AutoReverse = false,
                    RepeatBehavior = new RepeatBehavior(20),
                    FillBehavior = FillBehavior.HoldEnd
                };
                Storyboard storyboard2 = new Storyboard();
                Storyboard.SetTarget(doublea, darkMoon);
                Storyboard.SetTargetProperty(doublea, new PropertyPath(WidthProperty));
                storyboard2.Children.Add(doublea);
                storyboard2.Begin();

  • 相关阅读:
    去掉百度地图左下角文字和图标。
    使用CMake,且在GCC编译时指定相对源代码路径选项BUG的问题
    一键杀死某些指定进程的脚本
    KMS使用CLion作为IDE来调试
    ubuntu 18.04下安装编译的KMS,依赖库
    ubuntu 18.04下编译最新版本的KMS
    configure.ac中AC_CHECK_LIB的问题
    C/C++下__FILE__参数过长的问题解决办法
    Linux 下 UltraEdit 版本 破解 30 天试用限制
    ubuntu下配置ProFtpd服务使用sqlite3作为后端用户认证
  • 原文地址:https://www.cnblogs.com/androllen/p/2861742.html
Copyright © 2011-2022 走看看