Separating lines in Microsoft Ink

242 views Asked by At

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.

1

There are 1 answers

0
Sandra On

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.