2

Using Mircosoft.Ink, when I have a RecognizerContext rec, how can I separate the different lines? I need to get the text that was written per line and not everything together when I call rec.Recognize.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Sandra
  • 3,560
  • 5
  • 24
  • 31

1 Answers1

2

I finally found a solution:

Divider theDivider = new Divider(theStrokes, theRecognizerContext);

DivisionResult theResult = theDivider.Divide();  
DivisionUnits theDivisionUnits = theResult.ResultByType(InkDivisionType.Line);  

foreach (DivisionUnit theLine in theDivisionUnits)  
{    
    string theRecognitionString = theLine.RecognitionString;  
}

(Source: http://msdn.microsoft.com/en-us/library/microsoft.ink.divider.divide(v=VS.85).aspx)

Sadly, this does not work reliably, at least not for my input. For a three-line-input it sometimes recognizes only one line, sometimes two lines and rarely three lines. I don't know why, so I just analyzed the strokes myself and separated the lines.

Sandra
  • 3,560
  • 5
  • 24
  • 31