private void RemoveInkStrokes(InkAnalysisInkDrawing drawing) { foreach (var strokeId in drawing.GetStrokeIds()) { InkStroke stroke = _inkPresenter.StrokeContainer.GetStrokeById(strokeId); if (stroke != null) { stroke.Selected = true; } } _inkAnalyzer.RemoveDataForStrokes(drawing.GetStrokeIds()); }
private void RemoveStrokes(InkAnalysisInkDrawing shape) { // Find stroke that has id: strokeID and delete it foreach (var strokeId in shape.GetStrokeIds()) { RemoveStroke(strokeId); } }
// Draw a polygon on the recognitionCanvas. private void DrawPolygon(InkAnalysisInkDrawing shape) { var points = new List <Point>(shape.Points); var polygon = new Polygon(); foreach (var point in points) { polygon.Points.Add(point); } var stroke = inkCanvas.InkPresenter.StrokeContainer.GetStrokeById(shape.GetStrokeIds().First()); polygon.Stroke = new SolidColorBrush(stroke.DrawingAttributes.Color); polygon.StrokeThickness = 2; recognitionCanvas.Children.Add(polygon); }
// Draw an ellipse on the recognitionCanvas. private void DrawEllipse(InkAnalysisInkDrawing shape) { var points = shape.Points; var ellipse = new Ellipse(); ellipse.Width = shape.BoundingRect.Width; ellipse.Height = shape.BoundingRect.Height; Canvas.SetTop(ellipse, shape.BoundingRect.Top); Canvas.SetLeft(ellipse, shape.BoundingRect.Left); var stroke = inkCanvas.InkPresenter.StrokeContainer.GetStrokeById(shape.GetStrokeIds().First()); ellipse.Stroke = new SolidColorBrush(stroke.DrawingAttributes.Color); ellipse.StrokeThickness = 2; recognitionCanvas.Children.Add(ellipse); }