コード例 #1
0
ファイル: VobSubOcr.cs プロジェクト: mgziminsky/subtitleedit
        private void buttonLineOcrNewLanguage_Click(object sender, EventArgs e)
        {
            using (var newFolder = new VobSubOcrNewFolder(_ocrMethodIndex == _ocrMethodImageCompare))
            {
                if (newFolder.ShowDialog(this) == DialogResult.OK)
                {
                    string s = newFolder.FolderName;
                    if (string.IsNullOrEmpty(s))
                        return;
                    s = s.Replace("?", string.Empty).Replace("/", string.Empty).Replace("*", string.Empty).Replace("\\", string.Empty);
                    if (string.IsNullOrEmpty(s))
                        return;
                    if (File.Exists(Configuration.DictionariesFolder + "nOCR_" + newFolder.FolderName + ".xml"))
                    {
                        MessageBox.Show("Line OCR language file already exists!");
                        return;
                    }

                    _nOcrDb = null;
                    comboBoxNOcrLanguage.Items.Add(s);
                    comboBoxNOcrLanguage.SelectedIndex = comboBoxNOcrLanguage.Items.Count - 1;
                }
            }
        }
コード例 #2
0
ファイル: VobSubOcr.cs プロジェクト: mgziminsky/subtitleedit
 private void ButtonNewCharacterDatabaseClick(object sender, EventArgs e)
 {
     using (var newFolder = new VobSubOcrNewFolder(_ocrMethodIndex == _ocrMethodImageCompare))
     {
         if (newFolder.ShowDialog(this) == DialogResult.OK)
         {
             if (_ocrMethodIndex == _ocrMethodBinaryImageCompare)
             {
                 try
                 {
                     string fileName = Path.Combine(Configuration.OcrFolder, newFolder.FolderName + ".db");
                     if (File.Exists(fileName))
                     {
                         MessageBox.Show("OCR db already exists!");
                         return;
                     }
                     comboBoxCharacterDatabase.Items.Add(newFolder.FolderName);
                     comboBoxCharacterDatabase.SelectedIndex = comboBoxCharacterDatabase.Items.Count - 1;
                     _binaryOcrDb = new BinaryOcrDb(fileName);
                     _binaryOcrDb.Save();
                 }
                 catch (Exception exception)
                 {
                     MessageBox.Show(exception.Message);
                 }
             }
             else
             {
                 _vobSubOcrSettings.LastImageCompareFolder = newFolder.FolderName;
                 LoadImageCompareCharacterDatabaseList();
                 LoadImageCompareBitmaps();
             }
         }
     }
 }
コード例 #3
0
ファイル: VobSubOcr.cs プロジェクト: rebawest/subtitleedit
 private void ButtonNewCharacterDatabaseClick(object sender, EventArgs e)
 {
     var newFolder = new VobSubOcrNewFolder();
     if (newFolder.ShowDialog(this) == DialogResult.OK)
     {
         _vobSubOcrSettings.LastImageCompareFolder = newFolder.FolderName;
         LoadImageCompareCharacterDatabaseList();
         LoadImageCompareBitmaps();
     }
 }