I watch the Tablet Pc SDK sample InkRecognition and I add the following lines of code to perform strokes recognition with a custom recognizerContext that has a RecognizerGuide.
I want to turn the Recognizer on Boxed Input Mode.
When I set the guide property with a new RecognizerGuide an exception is trown.
Please Help me!
CODE LINES:
using (RecognizerContext myRecoContext = new RecognizerContext())
{
RecognitionStatus status;
RecognitionResult recoResult;
-----> myRecoContext.Guide= new Microsoft.Ink.RecognizerGuide(1,10,10,new Rectangle(0,0,20,20),new Rectangle(0,0,20,20));
myRecoContext.Strokes = myInkCollector.Ink.Strokes;
recoResult = myRecoContext.Recognize(out status);
txtResults.SelectedText = recoResult.TopString;
}
EXCEPTION STACK:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: The parameter is incorrect.
at Microsoft.Ink.InkRecognizerContextClass.set_Guide( InkRecognizerGuide RecognizerGuide)
at Microsoft.Ink.RecognizerContext.set_Guide(Recogniz erGuide value)
at InkRecognition.InkRecognition.btnRecognize_Click(O bject sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)