Пример #1
0
        public VobSubNOcrEdit(NOcrDb nOcrDb, Bitmap bitmap, string fileName)
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            VobSubEditCharacters.MakeToolStripLetters(contextMenuStripLetters, InsertLanguageCharacter);
            UiUtil.FixFonts(this);

            _nOcrDb = nOcrDb;
            _bitmap = bitmap;

            FillComboBox();

            if (bitmap != null)
            {
                pictureBoxCharacter.Image = bitmap;
                SizePictureBox();
            }

            labelInfo.Text         = $"{(_nOcrDb.OcrCharacters.Count + _nOcrDb.OcrCharactersExpanded.Count):#,###,##0} elements in database";
            labelNOcrCharInfo.Text = string.Empty;
            if (!string.IsNullOrEmpty(fileName))
            {
                Text = "nOCR DB - " + fileName;
            }

            if (comboBoxTexts.Items.Count > 0)
            {
                comboBoxTexts.SelectedIndex = 0;
            }
        }
        public VobSubOcrCharacterInspect()
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            VobSubEditCharacters.MakeToolStripLetters(contextMenuStripLetters, InsertLanguageCharacter);
            UiUtil.FixFonts(this);

            labelCount.Text       = string.Empty;
            labelExpandCount.Text = string.Empty;
            labelImageSize.Text   = string.Empty;
            Text = LanguageSettings.Current.VobSubOcrCharacterInspect.Title;
            groupBoxInspectItems.Text         = LanguageSettings.Current.VobSubOcrCharacterInspect.InspectItems;
            labelImageInfo.Text               = string.Empty;
            groupBoxCurrentCompareImage.Text  = LanguageSettings.Current.VobSubEditCharacters.CurrentCompareImage;
            labelTextAssociatedWithImage.Text = LanguageSettings.Current.VobSubEditCharacters.TextAssociatedWithImage;
            checkBoxItalic.Text               = LanguageSettings.Current.VobSubEditCharacters.IsItalic;
            buttonUpdate.Text         = LanguageSettings.Current.VobSubEditCharacters.Update;
            buttonDelete.Text         = LanguageSettings.Current.VobSubEditCharacters.Delete;
            buttonAddBetterMatch.Text = LanguageSettings.Current.VobSubOcrCharacterInspect.AddBetterMatch;
            labelDoubleSize.Text      = LanguageSettings.Current.VobSubEditCharacters.ImageDoubleSize;
            buttonOK.Text             = LanguageSettings.Current.General.Ok;
            buttonCancel.Text         = LanguageSettings.Current.General.Cancel;
            UiUtil.FixLargeFonts(this, buttonOK);
            buttonDetectFont.Visible = Configuration.Settings.General.ShowBetaStuff;
        }
 public VobSubOcrNOcrCharacter()
 {
     UiUtil.PreInitialize(this);
     InitializeComponent();
     VobSubEditCharacters.MakeToolStripLetters(contextMenuStripLetters, InsertLanguageCharacter);
     UiUtil.FixFonts(this);
     UiUtil.FixLargeFonts(this, buttonCancel);
     checkBoxAutoSubmitOfFirstChar.Text = LanguageSettings.Current.VobSubOcrCharacter.AutoSubmitOnFirstChar;
     labelItalicOn.Visible = false;
 }
Пример #4
0
        private void buttonEditCharacterDatabase_Click(object sender, EventArgs e)
        {
            var fileName    = Path.Combine(Configuration.OcrDirectory, comboBoxCharacterDatabase.SelectedItem + ".db");
            var binaryOcrDb = new BinaryOcrDb(fileName);

            binaryOcrDb.LoadCompareImages();
            using (var formVobSubEditCharacters = new VobSubEditCharacters(null, binaryOcrDb))
            {
                if (formVobSubEditCharacters.ShowDialog() == DialogResult.OK)
                {
                    binaryOcrDb.Save();
                }
            }
        }
Пример #5
0
        public VobSubNOcrCharacterInspect()
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            VobSubEditCharacters.MakeToolStripLetters(contextMenuStripLetters, InsertLanguageCharacter);
            UiUtil.FixFonts(this);
            labelImageSize.Text   = string.Empty;
            labelStatus.Text      = string.Empty;
            labelExpandCount.Text = string.Empty;

            buttonAddBetterMatch.Text = LanguageSettings.Current.VobSubOcrCharacterInspect.AddBetterMatch;
            buttonOK.Text             = LanguageSettings.Current.General.Ok;
            buttonCancel.Text         = LanguageSettings.Current.General.Cancel;
        }
Пример #6
0
        public VobSubOcrCharacter()
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            VobSubEditCharacters.MakeToolStripLetters(contextMenuStripLetters, InsertLanguageCharacter);
            UiUtil.FixFonts(this);

            var language = LanguageSettings.Current.VobSubOcrCharacter;

            Text = language.Title;
            labelSubtitleImage.Text    = language.SubtitleImage;
            buttonExpandSelection.Text = language.ExpandSelection;
            buttonShrinkSelection.Text = language.ShrinkSelection;
            labelCharacters.Text       = language.Characters;
            labelCharactersAsText.Text = language.CharactersAsText;
            checkBoxItalic.Text        = language.Italic;
            labelItalicOn.Text         = language.Italic.RemoveChar('&');
            labelItalicOn2.Text        = language.Italic.RemoveChar('&');
            labelItalicOn.Visible      = false;
            labelItalicOn2.Visible     = false;
            buttonAbort.Text           = language.Abort;
            buttonOK.Text   = LanguageSettings.Current.General.Ok;
            buttonSkip.Text = language.Skip;
            checkBoxAutoSubmitOfFirstChar.Text = language.AutoSubmitOnFirstChar;

            dataGridView1.Columns.Clear();
            var row1 = Configuration.Settings.Tools.OcrAddLetterRow1.Split(';').ToArray <object>();
            var row2 = Configuration.Settings.Tools.OcrAddLetterRow2.Split(';').ToArray <object>();

            for (int i = 0; i < Math.Max(row1.Length, row2.Length); i++)
            {
                dataGridView1.Columns.Add(string.Empty, string.Empty);
                dataGridView1.Columns[dataGridView1.Columns.Count - 1].Width            = 25;
                dataGridView1.Columns[dataGridView1.Columns.Count - 1].DefaultCellStyle = new DataGridViewCellStyle
                {
                    Alignment = DataGridViewContentAlignment.MiddleCenter,
                    ForeColor = UiUtil.ForeColor,
                    BackColor = UiUtil.BackColor
                };
            }
            dataGridView1.Rows.Add(row1);
            dataGridView1.Rows.Add(row2);
            dataGridView1.Rows[0].Height = dataGridView1.Height / 2;
            dataGridView1.Rows[1].Height = dataGridView1.Height / 2;
            UiUtil.FixLargeFonts(this, buttonSkip);
        }