本文整理汇总了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);
}