예제 #1
0
 void ic_Stroke(object sender, InkCollectorStrokeEventArgs e)
 {
     rct.StopBackgroundRecognition();
     rct.Strokes.Add(e.Stroke);
     //rct.CharacterAutoCompletion = RecognizerCharacterAutoCompletionMode.Prefix;
     rct.BackgroundRecognizeWithAlternates(0);
 }
예제 #2
0
        private void inkInput_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
        {
            if (inkInput.Strokes.Count == 0)
            {
                return;
            }
            MemoryStream ms = new MemoryStream();

            inkInput.Strokes.Save(ms);
            InkCollector myInkCollector = new InkCollector();
            Ink          ink            = new Ink();

            ink.Load(ms.ToArray());


            rct.StopBackgroundRecognition();

            rct.Strokes = ink.Strokes;
            // rct.CharacterAutoCompletion = RecognizerCharacterAutoCompletionMode.Full;

            rct.BackgroundRecognizeWithAlternates(0);


            //timer.Start();
        }
예제 #3
0
        private void btnRecognition_Click(object sender, EventArgs e)
        {
            string inkPadValue = ic.Ink.Strokes.ToString();

            if (!ic.CollectingInk)
            {
                Strokes strokesToDelete = ic.Ink.Strokes;
                rct.StopBackgroundRecognition();
                ic.Ink.DeleteStrokes(strokesToDelete);
                rct.Strokes = ic.Ink.Strokes;
                ic.Ink.DeleteStrokes();//清除手写区域笔画;
                PicInkPad.Refresh();
            }
            InkWritingEventArgs ev = new InkWritingEventArgs(inkPadValue);

            if (UserHandWriting != null)
            {
                UserHandWriting(this, ev);
            }
        }