WPF's InkAnalyzer worse than RecognizerContext? RRS feed

  • Question

  • Hello,

    I enconter a strange issue using WPF's InkAnalyzer. It hardly can recognize a single 'h' letter and sometimes has problems with the "hello" word. When it fails it recognizes the handwriting as "Other" shape. In contrast, the Microsoft.Ink's RecognizerContext perfectly recognizes 'h' and "hello" every time.


    I understand that WPF's InkAnalyzer is superiort to RecognizerContext, but in a WPF application that does not need to interpret shapes it's a real issue. I've tried checking alternates, using hints with factioids and other settings, but nothing helps.  Is there a way to to say to WPF's InkAnalyzer "Do not recognize any shapes at all" similarly to what RecognizerContext does?


    Thanks in advance

    Wednesday, April 16, 2008 8:49 AM

All replies

  • Hello Hristo.


    Can you show me your code where you implement InkAnalyzer?




    Eliot - MSFT


    Monday, April 21, 2008 1:26 AM
  • Hello Eliot,

    first of all thank you for your interest in my question. I made a sample project, as simple as possible, that produces the issue. If you write the 'h' letter several times and restart the app after every try, you will notice that quite often it is recognized as "Other" shape. So what I need is to simply turn off shape recognition and get a behavior similar to Microsoft.Ink's RecognizerContext.

    Code Snippet

    <Window x:Class="TestAnalyzer.Window1"






    <StackPanel Orientation="Vertical">

    <InkCanvas Name="inkCanvas" Width="600" Height="100" />

    <TextBox Name="textBlock" /></StackPanel></Grid></Window>




    Code Snippet

    public partial class Window1 : System.Windows.Window {


    InkAnalyzer _analyzer;


    public Window1() {



    inkCanvas.StrokeCollected +=

    new InkCanvasStrokeCollectedEventHandler(inkCanvas_StrokeCollected);

    inkCanvas.StrokeErasing +=

    new InkCanvasStrokeErasingEventHandler(inkCanvas_StrokeErasing);


    _analyzer = new InkAnalyzer();

    _analyzer.ResultsUpdated +=

    new ResultsUpdatedEventHandler(analyzer_ResultsUpdated);



    void inkCanvas_StrokeErasing(object sender, InkCanvasStrokeErasingEventArgs e) {





    void inkCanvas_StrokeCollected(object sender,

    InkCanvasStrokeCollectedEventArgs e) {





    void analyzer_ResultsUpdated(object sender, ResultsUpdatedEventArgs e) {

    textBlock.Text = _analyzer.GetRecognizedString();




    Monday, April 21, 2008 11:12 AM
  • I just want to let readers know that we are working with the product team for a complete solution to this question.


    Once we have that answer, we will post the solution here.




    Eliot - MSFT


    Wednesday, April 23, 2008 8:03 PM
  • I found it and it works as expected:


    Code Snippet

    void inkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e) {


    _analyzer.SetStrokeType(e.Stroke, StrokeType.Writing);





    Anyways, thank you for the effort.
    • Proposed as answer by Bibolorean Thursday, October 29, 2009 8:11 AM
    Thursday, April 24, 2008 9:27 AM
  • Hello Eliot, I'm still interested in your answer. I'm using the same process to recognize writings, but I didnt get such issues.
    Is there a way to ameliorate the recognition?
    I'm looking forward your solution.

    Best Regards


    Wednesday, May 21, 2008 10:05 AM