1

I am developing a note taking application. I want a user to write anything on canvas with InkManager of "Windows.UI.Input.Inking". Then I want to display it as text onto canvas and then I want to save those recognized text in either text or image format.

I have checked MSDN documentation, but still I am confused how to start. How can I get ink strokes onto canvas and how can I recognize that ? Please anyone can guide me ? I need it ASAP for my app.

I have tried this code, but it didn't work.

private async void Recognize_Click(object sender, RoutedEventArgs e)
{
    IReadOnlyList<InkRecognitionResult> x = await _inkManager.RecognizeAsync(InkRecognitionTarget.All);
    IReadOnlyList<String> text;
    foreach (InkRecognitionResult i in x)
    {
        text = i.GetTextCandidates();
        res.Text = text.First();
    }
}
Xyroid
  • 463
  • 5
  • 19
  • I am not getting any output, I just debug the program and checked the value of "text", but it is not showing. – Xyroid Jul 09 '12 at 10:54
  • You're overwriting text each time. Maybe just do a System.Diagnostics.Debug.WriteLine(i.GetTextCandidates()) to see the actual results printed out in the debugger. Maybe the last candidate is empty. – Sascha Jul 09 '12 at 10:56
  • finally I got some output i have added one text block (x:Name = res) and printed output on textblock, but still it can't recognize space (" ") PS : I have update source in question – Xyroid Jul 09 '12 at 11:55

1 Answers1

2

Finally got the solution myself

    IReadOnlyList<String> text;
    string finalt = "";  //for space
    private async void Recognize_Click(object sender, RoutedEventArgs e)
    {
        IReadOnlyList<InkRecognitionResult> x = await _inkManager.RecognizeAsync(InkRecognitionTarget.All);
        foreach (InkRecognitionResult i in x)
        {
            text = i.GetTextCandidates();
            finalt += " " + text[0];
            res.Text = finalt;  //res is the x:Key for the text block
        }
    }

One more solution and one more better solution

Xyroid
  • 463
  • 5
  • 19