We can use InkStrokeContainer.AddStroke to add to an InkStroke object to the collection managed by the InkStrokeContainer. If the shape is polygon, We can get the point from the InkAnalysisInkDrawing.Points and set them to the InkStrokeBuilder by the CreateStrokeFromInkPoints method.
For example:
private void AddPolygonToInkCanvas(InkAnalysisInkDrawing shape)
{
var strokeBuilder = new InkStrokeBuilder();
var strokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
strokeBuilder.SetDefaultDrawingAttributes(strokes[0].DrawingAttributes);
System.Numerics.Matrix3x2 matr = strokes[0].PointTransform;
List<InkPoint> inkPointslist = new List<InkPoint>();
foreach (var item in shape.Points)
{
var intpoint = new InkPoint(new Point(item.X, item.Y), 0.5f);
inkPointslist.Add(intpoint);
}
var lastintpoint = new InkPoint(new Point(shape.Points[0].X, shape.Points[0].Y), 0.5f);
inkPointslist.Add(lastintpoint);
IReadOnlyList<InkPoint> inkPoints = inkPointslist;
InkStroke stroke = strokeBuilder.CreateStrokeFromInkPoints(inkPoints, matr);
inkCanvas.InkPresenter.StrokeContainer.AddStroke(stroke);
}
If the shape is ellipse, as far as I known we can not add it to the InkCanvas. We can not get the all of the ellipse, it only provides 4 points.