locked
how to feed data to stroke and recogize RRS feed

  • Question

  • hi all,
      i have a winform without any ink control, it just a picture box, i record all the points(x,y) each time to seperate pack.
      then i send this data(pack1{piont1(x,y),point2(x,y)...},pack2{point1(x,y),....}) to my recognizer application.
      question is ,  how do feed this data into a stroke/strokes ?
     
                Ink ink = new Ink();//
                recgnzCtx.Strokes = ink.Strokes;
                for (int i = 0; i < data.Count; i++)
                {
                    ArrayList stroke = data[i] as ArrayList;

                    Point[] points = new Point[stroke.Count];
                    for (int k = 0; k < stroke.Count; k++)
                    {
                        points[i] = (Point)stroke[i];
                    }


                    Stroke stk = ink.CreateStroke(points);
                    recgnzCtx.Strokes.Add(stk);

                } 

           it does not work , the recognized result is wrong.
      
           what i can do to resolve this problem?

            btw,  the (x,y)data is simply converted to mm(my pc is 12inch,1268*800) 
                x = x * 26.46+0.5;
                y = y * 26.46+0.5; 

      thanks for help

    Monday, February 8, 2010 4:09 AM

Answers

  • resolved, i found the most stupid mistake i'v made, 
                   
                    for (int k = 0; k < stroke.Count; k++)
                    {
                        points[k] = (Point)stroke[k];//not "i", but "k"
                    }

    now my application work very well.
    Monday, February 8, 2010 4:33 AM