Ejemplo n.º 1
0
        public async Task <InkTransformResult> TransformTextAndShapesAsync()
        {
            var result     = new InkTransformResult(_drawingCanvas);
            var inkStrokes = GetStrokesToConvert();

            if (inkStrokes.Any())
            {
                _inkAnalyzer.ClearDataForAllStrokes();
                _inkAnalyzer.AddDataForStrokes(inkStrokes);
                var inkAnalysisResults = await _inkAnalyzer.AnalyzeAsync();

                if (inkAnalysisResults.Status == InkAnalysisStatus.Updated)
                {
                    var words  = AnalyzeWords();
                    var shapes = AnalyzeShapes();

                    //Generate result
                    result.Strokes.AddRange(inkStrokes);
                    result.TextAndShapes.AddRange(words);
                    result.TextAndShapes.AddRange(shapes);
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        public TransformUndoRedoOperation(InkTransformResult _transformResult, InkStrokesService _strokeService)
        {
            transformResult = _transformResult;
            strokeService   = _strokeService;

            strokeService.AddStrokeEvent += StrokeService_AddStrokeEvent;
        }