当前位置: 首页>>代码示例>>C#>>正文


C# ScaleTransform.ApplyAnimationClock方法代码示例

本文整理汇总了C#中System.Windows.Media.ScaleTransform.ApplyAnimationClock方法的典型用法代码示例。如果您正苦于以下问题:C# ScaleTransform.ApplyAnimationClock方法的具体用法?C# ScaleTransform.ApplyAnimationClock怎么用?C# ScaleTransform.ApplyAnimationClock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.ScaleTransform的用法示例。


在下文中一共展示了ScaleTransform.ApplyAnimationClock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ScaleEasingAnimation

 public void ScaleEasingAnimation(FrameworkElement element, double from, double to)
 {
     ScaleTransform scale = new ScaleTransform();
     element.RenderTransform = scale;
     element.RenderTransformOrigin = new Point(0.5, 0.5);//定义圆心位置
     DoubleAnimation scaleAnimation = new DoubleAnimation()
     {
         From = from,                                 //起始值
         To = to,                                     //结束值
         //EasingFunction = easing,                    //缓动函数
         Duration = new TimeSpan(0, 0, 0, 0, 200)    //动画播放时间
     };
     AnimationClock clock = scaleAnimation.CreateClock();
     scale.ApplyAnimationClock(ScaleTransform.ScaleXProperty, clock);
     scale.ApplyAnimationClock(ScaleTransform.ScaleYProperty, clock);
 }
开发者ID:TomasQin,项目名称:CustomOpenCards,代码行数:16,代码来源:SingleCardControl.xaml.cs

示例2: ScaleEasingAnimation

 public static  void ScaleEasingAnimation(FrameworkElement element)
 {
     ScaleTransform scale = new ScaleTransform();
     element.RenderTransform = scale;
     element.RenderTransformOrigin = new Point(0.5, 0.5);//定义圆心位置
     EasingFunctionBase easing = new ElasticEase()
     {
         EasingMode = EasingMode.EaseOut,            //公式
         Oscillations = 1,                           //滑过动画目标的次数
         Springiness = 10                             //弹簧刚度
     };
     DoubleAnimation scaleAnimation = new DoubleAnimation()
     {
         From = 0,                                 //起始值
         To = 1,                                     //结束值
         EasingFunction = easing,                    //缓动函数
         Duration = new TimeSpan(0, 0, 0, 1, 200)    //动画播放时间
     };
     AnimationClock clock = scaleAnimation.CreateClock();
     scale.ApplyAnimationClock(ScaleTransform.ScaleXProperty, clock);
     scale.ApplyAnimationClock(ScaleTransform.ScaleYProperty, clock);
 }
开发者ID:chijianfeng,项目名称:PNManager,代码行数:22,代码来源:AnimationUtil.cs

示例3: ClearScaleTransformAnimation

    private static void ClearScaleTransformAnimation( ScaleTransform transform )
    {
      if( transform == null )
        return;

      // Force a local value before removing the potential animation clock of this transform to avoid leaving the current animated value after animation is removed
      transform.CenterX = 0d;
      transform.ScaleX = 1d;
      transform.ApplyAnimationClock( ScaleTransform.ScaleXProperty, null );
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:10,代码来源:ColumnReorderingDragSourceManager.cs

示例4: ScaleEasingAnimation

 /// <summary>  
 /// 缓动缩放动画 (提升效率)Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata { DefaultValue = 20 });  
 /// </summary>  
 /// <param name="element">缩放控件</param>  
 /// <param name="aTime">缩放时间</param>  
 /// <param name="dFrom">缩放起始值(推荐1)</param>  
 /// <param name="dTo">缩放结束值(推荐1.5)</param>  
 /// <param name="aOscillations">滑过动画目标的次数(推荐5)</param>  
 /// <param name="aSpringiness">弹簧刚度(推荐10)</param>  
 /// <returns>返回动画对象</returns>  
 public static AnimationClock ScaleEasingAnimation(FrameworkElement element, TimeSpan aTime, double dFrom, double dTo, int aOscillations, int aSpringiness)
 {
     ScaleTransform scale = new ScaleTransform();
     element.RenderTransform = scale;
     element.RenderTransformOrigin = new Point(0.5, 0.5);//定义圆心位置
     EasingFunctionBase easing = new ElasticEase()
     {
         EasingMode = EasingMode.EaseOut,            //公式
         Oscillations = aOscillations,                           //滑过动画目标的次数
         Springiness = aSpringiness                             //弹簧刚度
     };
     DoubleAnimation scaleAnimation = new DoubleAnimation()
     {
         From = dFrom,                                 //起始值
         To = dTo,                                     //结束值
         EasingFunction = easing,                    //缓动函数
         Duration = aTime    //动画播放时间
     };
     AnimationClock clock = scaleAnimation.CreateClock();
     scale.ApplyAnimationClock(ScaleTransform.ScaleXProperty, clock);
     scale.ApplyAnimationClock(ScaleTransform.ScaleYProperty, clock);
     return clock;
 }
开发者ID:jxpxxzj,项目名称:WarshipGirl,代码行数:33,代码来源:AnimationHelper.cs


注:本文中的System.Windows.Media.ScaleTransform.ApplyAnimationClock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。