0

I want to Draw Path as shown in the Image , which is geometric path or shapes, I want to draw path using C# code not Xaml. I tried to make Rectangle and Circle and overlap those Rectangles and circles but didn't work, I want to draw path giving the geometric values like,

Either by using Path figure class , I had used this code.

var path = new Path(); path.Data = Geometry.Parse("M 100,200 C 100,25 400,350 400,175 H 280");

but this code didn't work in windows phone 7. To be precise the the Geometry.Parse did't work but using C# code.enter image description here

Puskarkc007
  • 174
  • 2
  • 14

1 Answers1

0

Whilst you can create this shape by adding and subtracting primitives (ellipses, rectangles, etc), for full flexibility, you are after the Path class

Using the values from your xaml example, it would look like this:

Path path = new Path();
path.Data = Geometry.Parse("M 100,200 C 100,25 400,350 400,175 H 280");

However, you can combine PathFigures to create more advanced shapes programmatically.

Gusdor
  • 14,001
  • 2
  • 52
  • 64