zoukankan      html  css  js  c++  java
  • Animation in Windows 8 apps

    在Windows 8 App里边的动画和在silverlight里边还有稍微的区别, 如代码:

    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Media.Animation;
    using Windows.UI.Xaml.Controls;
    
            protected void DemoAnimation()
            {
                Duration m_Dur = new Duration(TimeSpan.FromSeconds(4));
                Storyboard sb = new Storyboard();
                sb.Duration = m_Dur;
    
                DoubleAnimation topAnimation = new DoubleAnimation();
                topAnimation.Duration = m_Dur;
                DoubleAnimation leftAnimation = new DoubleAnimation();
                leftAnimation.Duration = m_Dur;
    
                Storyboard.SetTarget(topAnimation, myPictureCanvas);
                Storyboard.SetTargetProperty(topAnimation, "(Canvas.Top)");
                Storyboard.SetTarget(leftAnimation, myPictureCanvas);
                Storyboard.SetTargetProperty(leftAnimation, "(Canvas.Left)");
                topAnimation.EnableDependentAnimation = true;
                leftAnimation.EnableDependentAnimation = true;
                topAnimation.From = 0;
                leftAnimation.From = 0;
                topAnimation.To = 500;
                leftAnimation.To = 500;
    
    
                DoubleAnimation heightAnimation = new DoubleAnimation();
                heightAnimation.Duration = m_Dur;
                DoubleAnimation widthAnimation = new DoubleAnimation();
                widthAnimation.Duration = m_Dur;
    
                Storyboard.SetTarget(heightAnimation, myPictureCanvas);
                Storyboard.SetTargetProperty(heightAnimation, "(Canvas.Height)");
                Storyboard.SetTarget(widthAnimation, myPictureCanvas);
                Storyboard.SetTargetProperty(widthAnimation, "(Canvas.Width)");
                heightAnimation.EnableDependentAnimation = true;
                widthAnimation.EnableDependentAnimation = true;
                heightAnimation.From = 50;
                widthAnimation.From = 50;
                heightAnimation.To = 500;
                widthAnimation.To = 500;
                sb.Children.Add(heightAnimation);
                sb.Children.Add(widthAnimation);
    
                sb.Children.Add(topAnimation);
                sb.Children.Add(leftAnimation);
                sb.Begin();
            }
  • 相关阅读:
    文件操作
    通过类型断言获取error类型,获得更详细的信息

    数组
    使用unsafe改善性能
    使用unsafe.Pointer将结构体转为[]byte
    (GoRails)链接link_to到当前页current Page 并使用参数 (类ActionController::Parameters)
    用ActionController::Renderer的render方法渲染模版
    innerHTML用法及错误:无法设置未定义或null引用的属性“innerHTML”解决
    ActionCable的部署(参考Gorails)
  • 原文地址:https://www.cnblogs.com/qixue/p/2856579.html
Copyright © 2011-2022 走看看