• 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();
            }
  • 相关阅读:
    mongodb的常用操作(二)
    mongodb的常用操作
    OpenBSD内核之引导PBR
    OpenBSD内核之引导MBR
    OpenBSD之开篇
    “索引”、大数据的思考
    flume坑之channel.transactionCapacity和HdfsSink.batchSize
    cocos2d-x的CCAffineTransform相关变换实现原理
    MySQL JDBC/MyBatis Stream方式读取SELECT超大结果集
    “全服单世界”的终极目标即“虚拟世界”
  • 原文地址:https://www.cnblogs.com/qixue/p/2856579.html
Copyright © 2020-2023  润新知