Click here to Skip to main content
15,886,060 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Using the following code, I get a circle or arc drawing effect.

C#
using Microsoft.Expression.Shapes;

Arc a = new Arc();
a.ArcThicknessUnit = Microsoft.Expression.Media.UnitType.Pixel;
a.ArcThickness = 10;
a.StrokeThickness = 1;
a.Fill = new SolidColorBrush(Colors.Aqua);
a.Stroke = new SolidColorBrush(Colors.DarkMagenta);
a.StartAngle = 0;
a.EndAngle = 360;
a.Width = 200;
a.Height = 200;
a.Stretch = Stretch.None;
_myStackPanel.Children.Add(a);

DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromMilliseconds(1);
dt.Tick += (s, e) => { a.StartAngle = a.StartAngle + 4; };
dt.Start();



How can I get the effect of drawing a Bezier curve made in the same style? Do I need to animate a curve using a group of arcs? Or are there methods that do this in its entirety? I will be glad to the proposed links on this issue.

What I have tried:

I'm looking for a way to animate a Bezier curve.
Posted
Updated 26-May-20 23:19pm

1 solution

See this CodeProject article: A Purely XAML Coded Animated Bezier Curve via WPF[^]
 
Share this answer
 
Comments
Member 12618031 27-May-20 5:43am    
Thanks you. But this is a little not my case. I'm interested in the process of drawing and not transformation. And ideally on pure C#.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900