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


C# EllipseGeometry.ApplyAnimationClock方法代码示例

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


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

示例1: DrawEllipse

        /// <summary> 
        ///     DrawEllipse -
        ///     Draw an ellipse with the provided Brush and/or Pen. 
        ///     If both the Brush and Pen are null this call is a no-op. 
        /// </summary>
        /// <param name="brush"> 
        ///     The Brush with which to fill the ellipse.
        ///     This is optional, and can be null, in which case no fill is performed.
        /// </param>
        /// <param name="pen"> 
        ///     The Pen with which to stroke the ellipse.
        ///     This is optional, and can be null, in which case no stroke is performed. 
        /// </param> 
        /// <param name="center">
        ///     The center of the ellipse to fill and/or stroke. 
        /// </param>
        /// <param name="centerAnimations"> Optional AnimationClock for center. </param>
        /// <param name="radiusX">
        ///     The radius in the X dimension of the ellipse. 
        ///     The absolute value of the radius provided will be used.
        /// </param> 
        /// <param name="radiusXAnimations"> Optional AnimationClock for radiusX. </param> 
        /// <param name="radiusY">
        ///     The radius in the Y dimension of the ellipse. 
        ///     The absolute value of the radius provided will be used.
        /// </param>
        /// <param name="radiusYAnimations"> Optional AnimationClock for radiusY. </param>
        public override void DrawEllipse( 
            Brush brush,
            Pen pen, 
            Point center, 
            AnimationClock centerAnimations,
            Double radiusX, 
            AnimationClock radiusXAnimations,
            Double radiusY,
            AnimationClock radiusYAnimations)
        { 

        #if DEBUG 
            MediaTrace.DrawingContextOp.Trace("DrawEllipse(animate)"); 
        #endif
 
            //
            // Verify that parameters & state are valid
            //
 
            VerifyApiNonstructuralChange();
 
            if ((brush == null) && (pen == null)) 
            {
                return; 
            }

            //
            // Create a geometry & add animations if they exist 
            //
 
            // Instantiate the geometry 
            EllipseGeometry geometry = new EllipseGeometry(center, radiusX, radiusY);
 
            //
            // We may need to opt-out of inheritance through the new Freezable.
            // This is controlled by this.CanBeInheritanceContext.
            // 

            geometry.CanBeInheritanceContext = CanBeInheritanceContext; 
 
            // Setup the geometries freezable-related state
            SetupNewFreezable( 
                geometry,
                (centerAnimations == null) && // Freeze if there are no animations
                (radiusXAnimations == null) &&
                (radiusYAnimations == null) 
                );
 
            // Add animations to the geometry 
            if (centerAnimations != null)
            { 
                geometry.ApplyAnimationClock(EllipseGeometry.CenterProperty, centerAnimations);
            }

            if (radiusXAnimations != null) 
            {
                geometry.ApplyAnimationClock(EllipseGeometry.RadiusXProperty, radiusXAnimations); 
            } 

            if (radiusYAnimations != null) 
            {
                geometry.ApplyAnimationClock(EllipseGeometry.RadiusYProperty, radiusYAnimations);
            }
 
            //
            // Add Drawing to the Drawing graph 
            // 

            AddNewGeometryDrawing(brush, pen, geometry); 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:97,代码来源:DrawingDrawingContext.cs


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