Beispiel #1
0
        private void CreateFont()
        {
            FontCreator fontCreator = new FontCreator();

            fontCreator.Add(@"C:\Users\egor0\source\repos\Handwriting Generator\Handwriting Generator\Resources\testing\0o.png");
            fontCreator.Add(@"C:\Users\egor0\source\repos\Handwriting Generator\Handwriting Generator\Resources\testing\1o.png");
            fontCreator.Add(@"C:\Users\egor0\source\repos\Handwriting Generator\Handwriting Generator\Resources\testing\2o.png");
            Font font = fontCreator.GetFont();

            font.Save("DebugOut/savedFontOleg.zip");
            Console.WriteLine("done");
        }
Beispiel #2
0
        private void LoadFormImage(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter = "Image Files |*.jpg;*.jpeg;*.png";
            if (dialog.ShowDialog() != true)
            {
                return;
            }

            Font font;

            try
            {
                FontCreator fontCreator = new FontCreator();
                fontCreator.Add(dialog.FileName);
                font = fontCreator.GetFont();
            }
            catch (FormException exc)
            {
                string message = "Exception while processing the form. ";
                if (exc.InnerException != null)
                {
                    message += exc.InnerException.Message;
                }
                MessageBox.Show(message);
                return;
            }

            if (loadedFont == null)
            {
                loadedFont = font;
            }
            else
            {
                loadedFont.AddFromOther(font);
            }

            UpdateCharacterList();
            UpdateSampleList(null, null);
        }