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();
            }
  • 相关阅读:
    用OLEDB读取EXCEL时,单元格内容长度超过255被截断
    jquery对属性和特性的操作
    yum报[Errno 256] No more mirrors to try
    c语言:计算数组长度
    递归之100.相同的树
    1160.Find Words That Can Be Formed By Characters
    892.surface area of 3D shapes
    递归之24&206(链表)
    C++ private
    Dell 7559 安装黑苹果 Mojave14.15.6
  • 原文地址:https://www.cnblogs.com/qixue/p/2856579.html
Copyright © 2011-2022 走看看