Exemple #1
0
        static void Main()
        {
            KSvc.Service serv = new KSvc.Service();

            //don't show metadata
            serv.ShowMetaData = false;

            //starting service
            PointLoadObserver plso = new PointLoadObserver();
            ThreadStart tStart = delegate { serv.Run(plso); };
            Thread t = new Thread(tStart);
            t.Start();

            //starting mirror GUI
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //get characters
            List<Character> characterdatabase =
                UPXReader.ParseUPXFile(
                    File.Open("C:\\Diplom\\kanjiteacher\\data\\exampleFormat.upx", FileMode.Open));

            //initialise viewing area
            MirrorArea ma = new MirrorArea(plso);

            //go through all the strokes in the database
            //fill viewing area
            foreach (Character c in characterdatabase)
            {
                foreach (Stroke dbStroke in c.StrokeList)
                {
                    plso.ReveivePoints(dbStroke.AllPoints);
                }
            }

            //show viewing area
            ma.ShowDialog();
            ma.Hide();
            ma.Close();
            ma.Dispose();
            t.Abort();

            //            Application.Run(new MirrorArea(plso));
        }
Exemple #2
0
        private static void TestInkMLReading()
        {
            KSvc.Service serv = new KSvc.Service();

            //don't show metadata
            serv.ShowMetaData = false;

            //starting service
            PointLoadObserver plso = new PointLoadObserver();
            ThreadStart tStart = delegate { serv.Run(plso); };
            Thread t = new Thread(tStart);
            t.Start();

            //starting mirror GUI
            F.Application.EnableVisualStyles();
            F.Application.SetCompatibleTextRenderingDefault(false);

            //initialise viewing area
            MirrorArea ma = new MirrorArea(plso);
            List<Stroke> strokes = new List<Stroke>();
            //strokes = InkMLReader.ReadInkMLFile("char02211.inkml");
            //strokes = InkMLReader.ReadInkMLFile("char00846.inkml");
            //strokes = InkMLReader.ReadInkMLFile("char00555.inkml");
            //strokes = InkMLReader.ReadInkMLFile("char00117.inkml");
            //strokes = InkMLReader.ReadInkMLFile("char00935.inkml");
            strokes = InkMLReader.ReadInkMLFile("char00117vs935hybrid.inkml");

            //go through all the strokes in the file
            //fill viewing area
            foreach (Stroke dbStroke in strokes)
            {
                plso.ReveivePoints(dbStroke.AllPoints);
            }

            //show viewing area
            ma.ShowDialog();
            ma.Hide();
            ma.Close();
            ma.Dispose();
            t.Abort();
        }