/// <summary> /// Default constructor. /// </summary> public SurfaceWindow1() { InitializeComponent(); Path myShape = new Path(); myShape.StrokeThickness = 3.0; myShape.Fill = System.Windows.Media.Brushes.Wheat; myShape.Stroke = System.Windows.Media.Brushes.BlueViolet; PathGeometry myGeometry = new PathGeometry(); PathFigure figure = new PathFigure(); //Figure draws the segments upside down (this the coordinate system in negatives to draw objects) Double width = 200; Double height = 100; figure.SetValue(PathFigure.StartPointProperty, new Point(height, 0)); ArcSegment arc = new ArcSegment(new Point(height, height), new Size(height / 2, height / 2), 0.0, true, SweepDirection.Counterclockwise, true); //Note: LineSegments take end point as the constructor, Their Start point will be the end point of previous segment(the order you added into path figure(Source API)) LineSegment arcVertical1 = new LineSegment(new Point(height, height - 25), true); LineSegment horizontal1 = new LineSegment(new Point(height + 275, height - 25), true); LineSegment vertical = new LineSegment(new Point(height + 275, 25), true); LineSegment horizontal2 = new LineSegment(new Point(height, 25), true); LineSegment arcVertical2 = new LineSegment(new Point(height, 0), true); figure.Segments.Add(arc); figure.Segments.Add(arcVertical1); figure.Segments.Add(horizontal1); figure.Segments.Add(vertical); figure.Segments.Add(horizontal2); figure.Segments.Add(arcVertical2); myGeometry.Figures.Add(figure); myShape.Data = myGeometry; myCanvas.Children.Add(myShape); //****************************** Register for Stroke change events************************* // This is how we can get the currently being drawn stroke information inkCanvas.Strokes.StrokesChanged += new StrokeCollectionChangedEventHandler(canvasStrokesChanged); // Add handlers for window availability events AddWindowAvailabilityHandlers(); }