• 一个小范围 滑动的动画 GIS


    public void Transform(double from, double to, FrameworkElement target, double duration)
          {
              Storyboard sb = new Storyboard();

              ScaleTransform scale = new ScaleTransform();
              target.RenderTransform = scale;
              target.RenderTransformOrigin = new Point(0.5, 0.5);

              DoubleAnimation dX = new DoubleAnimation();
              dX.To = to;
              dX.From = from;
              dX.EasingFunction = new PowerEase() { EasingMode = EasingMode.EaseOut };
              dX.Duration = TimeSpan.FromSeconds(duration);
              sb.Children.Add(dX);

              DoubleAnimation dY = new DoubleAnimation();
              dY.To = to;
              dY.From = from;
              dY.EasingFunction = new PowerEase() { EasingMode = EasingMode.EaseOut };
              dY.Duration = TimeSpan.FromSeconds(duration);
              sb.Children.Add(dY);

              DoubleAnimation dao = new DoubleAnimation();
              dao.To = to;
              dao.Duration = TimeSpan.FromSeconds(duration);
              sb.Children.Add(dao);

              Storyboard.SetTarget(dX, scale);
              Storyboard.SetTargetProperty(dX, new PropertyPath("ScaleX"));

              Storyboard.SetTarget(dY, scale);
              Storyboard.SetTargetProperty(dY, new PropertyPath("ScaleY"));

              Storyboard.SetTarget(dao, target);
              Storyboard.SetTargetProperty(dao, new PropertyPath("Opacity"));

              sb.Begin();
          }

    调用方法 如下

      Transform(1, 0.75, _item, 0.2);

    _item 是listboxitem 类型

  • 相关阅读:
    Android学习—Shape
    Android学习—Application的作用
    用户管理
    DPKG命令与软件安装、APT
    Linux学习笔记
    C如何使用内存
    九九乘法表.py
    超市买苹果.py
    第一个程序python.py
    JavaScript一些备忘知识
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/2537846.html
Copyright © 2020-2023  润新知