mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Working on ocr via image compare
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@534 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
c3cb85410a
commit
5071010b7c
40
src/Forms/GoogleOrMicrosoftTranslate.Designer.cs
generated
40
src/Forms/GoogleOrMicrosoftTranslate.Designer.cs
generated
@ -31,8 +31,8 @@
|
||||
this.buttonMicrosoft = new System.Windows.Forms.Button();
|
||||
this.buttonGoogle = new System.Windows.Forms.Button();
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.labelGoogleTranslate = new System.Windows.Forms.Label();
|
||||
this.labelMicrosoftTranslate = new System.Windows.Forms.Label();
|
||||
this.comboBoxFrom = new System.Windows.Forms.ComboBox();
|
||||
this.buttonTranslate = new System.Windows.Forms.Button();
|
||||
this.labelTo = new System.Windows.Forms.Label();
|
||||
@ -71,23 +71,23 @@
|
||||
this.buttonCancel.Text = "C&ancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label1
|
||||
// labelGoogleTranslate
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(14, 148);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(84, 13);
|
||||
this.label1.TabIndex = 20;
|
||||
this.label1.Text = "Google translate";
|
||||
this.labelGoogleTranslate.AutoSize = true;
|
||||
this.labelGoogleTranslate.Location = new System.Drawing.Point(14, 148);
|
||||
this.labelGoogleTranslate.Name = "labelGoogleTranslate";
|
||||
this.labelGoogleTranslate.Size = new System.Drawing.Size(84, 13);
|
||||
this.labelGoogleTranslate.TabIndex = 20;
|
||||
this.labelGoogleTranslate.Text = "Google translate";
|
||||
//
|
||||
// label4
|
||||
// labelMicrosoftTranslate
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(319, 148);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(93, 13);
|
||||
this.label4.TabIndex = 21;
|
||||
this.label4.Text = "Microsoft translate";
|
||||
this.labelMicrosoftTranslate.AutoSize = true;
|
||||
this.labelMicrosoftTranslate.Location = new System.Drawing.Point(319, 148);
|
||||
this.labelMicrosoftTranslate.Name = "labelMicrosoftTranslate";
|
||||
this.labelMicrosoftTranslate.Size = new System.Drawing.Size(93, 13);
|
||||
this.labelMicrosoftTranslate.TabIndex = 21;
|
||||
this.labelMicrosoftTranslate.Text = "Microsoft translate";
|
||||
//
|
||||
// comboBoxFrom
|
||||
//
|
||||
@ -164,8 +164,8 @@
|
||||
this.Controls.Add(this.labelTo);
|
||||
this.Controls.Add(this.comboBoxTo);
|
||||
this.Controls.Add(this.labelFrom);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.labelMicrosoftTranslate);
|
||||
this.Controls.Add(this.labelGoogleTranslate);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.buttonGoogle);
|
||||
this.Controls.Add(this.buttonMicrosoft);
|
||||
@ -187,8 +187,8 @@
|
||||
private System.Windows.Forms.Button buttonMicrosoft;
|
||||
private System.Windows.Forms.Button buttonGoogle;
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label labelGoogleTranslate;
|
||||
private System.Windows.Forms.Label labelMicrosoftTranslate;
|
||||
private System.Windows.Forms.ComboBox comboBoxFrom;
|
||||
private System.Windows.Forms.Button buttonTranslate;
|
||||
private System.Windows.Forms.Label labelTo;
|
||||
|
@ -17,6 +17,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
RemovedLanguagesNotInMicrosoftTranslate(comboBoxFrom);
|
||||
RemovedLanguagesNotInMicrosoftTranslate(comboBoxTo);
|
||||
|
||||
Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.Title;
|
||||
labelGoogleTranslate.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.GoogleTranslate;
|
||||
labelMicrosoftTranslate.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.MicrosoftTranslate;
|
||||
labelFrom.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.From;
|
||||
labelTo.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.To;
|
||||
labelSourceText.Text = Configuration.Settings.Language.GoogleOrMicrosoftTranslate.SourceText;
|
||||
|
20
src/Forms/VobSubEditCharacters.Designer.cs
generated
20
src/Forms/VobSubEditCharacters.Designer.cs
generated
@ -53,7 +53,7 @@
|
||||
//
|
||||
this.comboBoxTexts.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxTexts.FormattingEnabled = true;
|
||||
this.comboBoxTexts.Location = new System.Drawing.Point(12, 35);
|
||||
this.comboBoxTexts.Location = new System.Drawing.Point(12, 27);
|
||||
this.comboBoxTexts.Name = "comboBoxTexts";
|
||||
this.comboBoxTexts.Size = new System.Drawing.Size(240, 21);
|
||||
this.comboBoxTexts.TabIndex = 1;
|
||||
@ -62,7 +62,7 @@
|
||||
// listBoxFileNames
|
||||
//
|
||||
this.listBoxFileNames.FormattingEnabled = true;
|
||||
this.listBoxFileNames.Location = new System.Drawing.Point(12, 83);
|
||||
this.listBoxFileNames.Location = new System.Drawing.Point(12, 73);
|
||||
this.listBoxFileNames.Name = "listBoxFileNames";
|
||||
this.listBoxFileNames.Size = new System.Drawing.Size(240, 251);
|
||||
this.listBoxFileNames.TabIndex = 3;
|
||||
@ -72,7 +72,7 @@
|
||||
//
|
||||
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonOK.Location = new System.Drawing.Point(368, 351);
|
||||
this.buttonOK.Location = new System.Drawing.Point(368, 341);
|
||||
this.buttonOK.Name = "buttonOK";
|
||||
this.buttonOK.Size = new System.Drawing.Size(75, 21);
|
||||
this.buttonOK.TabIndex = 0;
|
||||
@ -93,7 +93,7 @@
|
||||
// labelChooseCharacters
|
||||
//
|
||||
this.labelChooseCharacters.AutoSize = true;
|
||||
this.labelChooseCharacters.Location = new System.Drawing.Point(12, 18);
|
||||
this.labelChooseCharacters.Location = new System.Drawing.Point(12, 10);
|
||||
this.labelChooseCharacters.Name = "labelChooseCharacters";
|
||||
this.labelChooseCharacters.Size = new System.Drawing.Size(105, 13);
|
||||
this.labelChooseCharacters.TabIndex = 0;
|
||||
@ -102,7 +102,7 @@
|
||||
// labelImageCompareFiles
|
||||
//
|
||||
this.labelImageCompareFiles.AutoSize = true;
|
||||
this.labelImageCompareFiles.Location = new System.Drawing.Point(12, 66);
|
||||
this.labelImageCompareFiles.Location = new System.Drawing.Point(12, 56);
|
||||
this.labelImageCompareFiles.Name = "labelImageCompareFiles";
|
||||
this.labelImageCompareFiles.Size = new System.Drawing.Size(103, 13);
|
||||
this.labelImageCompareFiles.TabIndex = 2;
|
||||
@ -119,7 +119,7 @@
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.labelImageInfo);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.textBoxText);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.pictureBox1);
|
||||
this.groupBoxCurrentCompareImage.Location = new System.Drawing.Point(258, 77);
|
||||
this.groupBoxCurrentCompareImage.Location = new System.Drawing.Point(258, 67);
|
||||
this.groupBoxCurrentCompareImage.Name = "groupBoxCurrentCompareImage";
|
||||
this.groupBoxCurrentCompareImage.Size = new System.Drawing.Size(266, 268);
|
||||
this.groupBoxCurrentCompareImage.TabIndex = 6;
|
||||
@ -205,10 +205,10 @@
|
||||
//
|
||||
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonCancel.Location = new System.Drawing.Point(449, 351);
|
||||
this.buttonCancel.Location = new System.Drawing.Point(449, 341);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
|
||||
this.buttonCancel.TabIndex = 1;
|
||||
this.buttonCancel.TabIndex = 7;
|
||||
this.buttonCancel.Text = "C&ancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
@ -216,7 +216,7 @@
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(536, 380);
|
||||
this.ClientSize = new System.Drawing.Size(536, 370);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.groupBoxCurrentCompareImage);
|
||||
this.Controls.Add(this.labelImageCompareFiles);
|
||||
@ -258,7 +258,7 @@
|
||||
private System.Windows.Forms.Label labelImageInfo;
|
||||
private System.Windows.Forms.TextBox textBoxText;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.CheckBox checkBoxItalic;
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string _directoryPath;
|
||||
List<bool> _italics = new List<bool>();
|
||||
bool _focusTextBox = false;
|
||||
internal List<VobSubOcr.ImageCompareAddition> Additions { get; private set; }
|
||||
|
||||
public XmlDocument ImageCompareDocument
|
||||
{
|
||||
@ -23,9 +24,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
public VobSubEditCharacters(string databaseFolderName)
|
||||
internal VobSubEditCharacters(string databaseFolderName, List<VobSubOcr.ImageCompareAddition> additions)
|
||||
{
|
||||
InitializeComponent();
|
||||
Additions = new List<VobSubOcr.ImageCompareAddition>();
|
||||
foreach (var a in additions)
|
||||
Additions.Add(a);
|
||||
labelImageInfo.Text = string.Empty;
|
||||
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
|
||||
|
||||
@ -35,7 +39,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
else
|
||||
_compareDoc.Load(_directoryPath + "CompareDescription.xml");
|
||||
|
||||
FillComboWithUniqueAndSortedTexts();
|
||||
Refill(Additions);
|
||||
|
||||
Text = Configuration.Settings.Language.VobSubEditCharacters.Title;
|
||||
labelChooseCharacters.Text = Configuration.Settings.Language.VobSubEditCharacters.ChooseCharacter;
|
||||
@ -51,11 +55,51 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
FixLargeFonts();
|
||||
}
|
||||
|
||||
private void Refill(List<VobSubOcr.ImageCompareAddition> additions)
|
||||
{
|
||||
if (additions != null)
|
||||
{
|
||||
labelChooseCharacters.Visible = false;
|
||||
comboBoxTexts.Visible = false;
|
||||
FillLastAdditions(additions);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillComboWithUniqueAndSortedTexts();
|
||||
}
|
||||
}
|
||||
|
||||
private void FillLastAdditions(List<VobSubOcr.ImageCompareAddition> additions)
|
||||
{
|
||||
_italics = new List<bool>();
|
||||
listBoxFileNames.Items.Clear();
|
||||
foreach (XmlNode node in _compareDoc.DocumentElement.ChildNodes)
|
||||
{
|
||||
if (node.Attributes["Text"] != null)
|
||||
{
|
||||
string text = node.Attributes["Text"].InnerText;
|
||||
string name = node.InnerText;
|
||||
foreach (VobSubOcr.ImageCompareAddition a in additions)
|
||||
{
|
||||
if (name == a.Name)
|
||||
{
|
||||
listBoxFileNames.Items.Add("[" + text +"] " + node.InnerText + ".bmp");
|
||||
_italics.Add(node.Attributes["Italic"] != null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (listBoxFileNames.Items.Count > 0)
|
||||
listBoxFileNames.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void FixLargeFonts()
|
||||
{
|
||||
Graphics graphics = this.CreateGraphics();
|
||||
SizeF textSize = graphics.MeasureString(buttonCancel.Text, this.Font);
|
||||
if (textSize.Height > buttonCancel.Height - 4)
|
||||
SizeF textSize = graphics.MeasureString(buttonOK.Text, this.Font);
|
||||
if (textSize.Height > buttonOK.Height - 4)
|
||||
{
|
||||
int newButtonHeight = (int)(textSize.Height + 7 + 0.5);
|
||||
Utilities.SetButtonHeight(this, newButtonHeight, 1);
|
||||
@ -109,10 +153,26 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
listBoxFileNames.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private string GetSelectedFileName()
|
||||
{
|
||||
string fileName = listBoxFileNames.SelectedItem.ToString();
|
||||
if (fileName.StartsWith("["))
|
||||
fileName = fileName.Substring(fileName.IndexOf("]") + 1);
|
||||
return fileName.Trim();
|
||||
}
|
||||
|
||||
private string GetFileName(int index)
|
||||
{
|
||||
string fileName = listBoxFileNames.Items[index].ToString();
|
||||
if (fileName.StartsWith("["))
|
||||
fileName = fileName.Substring(fileName.IndexOf("]") + 1);
|
||||
return fileName.Trim();
|
||||
}
|
||||
|
||||
private void ListBoxFileNamesSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkBoxItalic.Checked = _italics[listBoxFileNames.SelectedIndex];
|
||||
string fileName = _directoryPath + listBoxFileNames.SelectedItem;
|
||||
string fileName = _directoryPath + GetSelectedFileName();
|
||||
Bitmap bmp;
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
@ -136,6 +196,19 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
pictureBox2.Width = bmp.Width * 2;
|
||||
pictureBox2.Height = bmp.Height * 2;
|
||||
pictureBox2.Image = bmp;
|
||||
|
||||
if (Additions != null)
|
||||
{
|
||||
string target = GetSelectedFileName();
|
||||
foreach (var a in Additions)
|
||||
{
|
||||
if (target.StartsWith(a.Name))
|
||||
{
|
||||
textBoxText.Text = a.Text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void VobSubEditCharacters_KeyDown(object sender, KeyEventArgs e)
|
||||
@ -146,7 +219,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void ButtonUpdateClick(object sender, EventArgs e)
|
||||
{
|
||||
string target = listBoxFileNames.SelectedItem.ToString();
|
||||
if (listBoxFileNames.Items.Count == 0)
|
||||
return;
|
||||
|
||||
string target = GetSelectedFileName();
|
||||
target = target.Substring(0, target.Length - 4);
|
||||
XmlNode node = _compareDoc.DocumentElement.SelectSingleNode("FileName[.='" + target + "']");
|
||||
if (node != null)
|
||||
@ -154,6 +230,19 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string newText = textBoxText.Text;
|
||||
node.Attributes["Text"].InnerText = newText;
|
||||
|
||||
if (Additions != null)
|
||||
{
|
||||
foreach (var a in Additions)
|
||||
{
|
||||
if (target.StartsWith(a.Name))
|
||||
{
|
||||
a.Text = newText;
|
||||
a.Italic = checkBoxItalic.Checked;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (checkBoxItalic.Checked)
|
||||
{
|
||||
if (node.Attributes["Italic"] == null)
|
||||
@ -171,18 +260,21 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
FillComboWithUniqueAndSortedTexts();
|
||||
for (int i = 0; i < comboBoxTexts.Items.Count; i++)
|
||||
Refill(Additions);
|
||||
if (Additions == null)
|
||||
{
|
||||
if (comboBoxTexts.Items[i].ToString() == newText)
|
||||
for (int i = 0; i < comboBoxTexts.Items.Count; i++)
|
||||
{
|
||||
comboBoxTexts.SelectedIndex = i;
|
||||
for (int j = 0; j < listBoxFileNames.Items.Count; j++)
|
||||
if (comboBoxTexts.Items[i].ToString() == newText)
|
||||
{
|
||||
if (listBoxFileNames.Items[j].ToString().StartsWith(target))
|
||||
listBoxFileNames.SelectedIndex = j;
|
||||
comboBoxTexts.SelectedIndex = i;
|
||||
for (int j = 0; j < listBoxFileNames.Items.Count; j++)
|
||||
{
|
||||
if (GetFileName(j).StartsWith(target))
|
||||
listBoxFileNames.SelectedIndex = j;
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -190,16 +282,35 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void ButtonDeleteClick(object sender, EventArgs e)
|
||||
{
|
||||
if (listBoxFileNames.Items.Count == 0)
|
||||
return;
|
||||
|
||||
int oldComboBoxIndex = comboBoxTexts.SelectedIndex;
|
||||
string target = listBoxFileNames.SelectedItem.ToString();
|
||||
string target = GetSelectedFileName();
|
||||
target = target.Substring(0, target.Length - 4);
|
||||
XmlNode node = _compareDoc.DocumentElement.SelectSingleNode("FileName[.='" + target + "']");
|
||||
if (node != null)
|
||||
{
|
||||
_compareDoc.DocumentElement.RemoveChild(node);
|
||||
FillComboWithUniqueAndSortedTexts();
|
||||
if (oldComboBoxIndex < comboBoxTexts.Items.Count)
|
||||
comboBoxTexts.SelectedIndex = oldComboBoxIndex;
|
||||
if (Additions != null)
|
||||
{
|
||||
for (int i = Additions.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (Additions[i].Name == target)
|
||||
{
|
||||
Additions.RemoveAt(i);
|
||||
Refill(Additions);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Refill(Additions);
|
||||
if (Additions == null)
|
||||
{
|
||||
if (oldComboBoxIndex < comboBoxTexts.Items.Count)
|
||||
comboBoxTexts.SelectedIndex = oldComboBoxIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +325,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
comboBoxTexts.SelectedIndex = i;
|
||||
for (int j = 0; j < listBoxFileNames.Items.Count; j++)
|
||||
{
|
||||
if (listBoxFileNames.Items[j].ToString().StartsWith(name))
|
||||
if (GetFileName(j).StartsWith(name))
|
||||
listBoxFileNames.SelectedIndex = j;
|
||||
}
|
||||
_focusTextBox = true;
|
||||
@ -238,5 +349,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
58
src/Forms/VobSubOcr.Designer.cs
generated
58
src/Forms/VobSubOcr.Designer.cs
generated
@ -41,6 +41,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.saveImageAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveAllImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparatorImageCompare = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.EditLastAdditionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.labelSubtitleText = new System.Windows.Forms.Label();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.labelStatus = new System.Windows.Forms.Label();
|
||||
@ -100,8 +103,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.checkBoxShowOnlyForced = new System.Windows.Forms.CheckBox();
|
||||
this.checkBoxUseTimeCodesFromIdx = new System.Windows.Forms.CheckBox();
|
||||
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
|
||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSubtitleImage)).BeginInit();
|
||||
this.contextMenuStripListview.SuspendLayout();
|
||||
this.groupBoxOcrMethod.SuspendLayout();
|
||||
@ -147,63 +150,85 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.toolStripSeparator2,
|
||||
this.saveImageAsToolStripMenuItem,
|
||||
this.saveAllImagesToolStripMenuItem,
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem});
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem,
|
||||
this.toolStripSeparatorImageCompare,
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem,
|
||||
this.EditLastAdditionsToolStripMenuItem});
|
||||
this.contextMenuStripListview.Name = "contextMenuStripListview";
|
||||
this.contextMenuStripListview.Size = new System.Drawing.Size(283, 170);
|
||||
this.contextMenuStripListview.Size = new System.Drawing.Size(306, 220);
|
||||
this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening);
|
||||
//
|
||||
// normalToolStripMenuItem
|
||||
//
|
||||
this.normalToolStripMenuItem.Name = "normalToolStripMenuItem";
|
||||
this.normalToolStripMenuItem.Size = new System.Drawing.Size(282, 22);
|
||||
this.normalToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.normalToolStripMenuItem.Text = "Normal";
|
||||
this.normalToolStripMenuItem.Click += new System.EventHandler(this.NormalToolStripMenuItemClick);
|
||||
//
|
||||
// italicToolStripMenuItem
|
||||
//
|
||||
this.italicToolStripMenuItem.Name = "italicToolStripMenuItem";
|
||||
this.italicToolStripMenuItem.Size = new System.Drawing.Size(282, 22);
|
||||
this.italicToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.italicToolStripMenuItem.Text = "Italic";
|
||||
this.italicToolStripMenuItem.Click += new System.EventHandler(this.ItalicToolStripMenuItemClick);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(279, 6);
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(302, 6);
|
||||
//
|
||||
// importTextWithMatchingTimeCodesToolStripMenuItem
|
||||
//
|
||||
this.importTextWithMatchingTimeCodesToolStripMenuItem.Name = "importTextWithMatchingTimeCodesToolStripMenuItem";
|
||||
this.importTextWithMatchingTimeCodesToolStripMenuItem.Size = new System.Drawing.Size(282, 22);
|
||||
this.importTextWithMatchingTimeCodesToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.importTextWithMatchingTimeCodesToolStripMenuItem.Text = "Import text with matching time codes...";
|
||||
this.importTextWithMatchingTimeCodesToolStripMenuItem.Click += new System.EventHandler(this.importTextWithMatchingTimeCodesToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(279, 6);
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(302, 6);
|
||||
//
|
||||
// saveImageAsToolStripMenuItem
|
||||
//
|
||||
this.saveImageAsToolStripMenuItem.Name = "saveImageAsToolStripMenuItem";
|
||||
this.saveImageAsToolStripMenuItem.Size = new System.Drawing.Size(282, 22);
|
||||
this.saveImageAsToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.saveImageAsToolStripMenuItem.Text = "Save image as...";
|
||||
this.saveImageAsToolStripMenuItem.Click += new System.EventHandler(this.SaveImageAsToolStripMenuItemClick);
|
||||
//
|
||||
// saveAllImagesToolStripMenuItem
|
||||
//
|
||||
this.saveAllImagesToolStripMenuItem.Name = "saveAllImagesToolStripMenuItem";
|
||||
this.saveAllImagesToolStripMenuItem.Size = new System.Drawing.Size(282, 22);
|
||||
this.saveAllImagesToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.saveAllImagesToolStripMenuItem.Text = "Save all images (png/bdn xml)...";
|
||||
this.saveAllImagesToolStripMenuItem.Click += new System.EventHandler(this.saveAllImagesToolStripMenuItem_Click);
|
||||
//
|
||||
// saveAllImagesWithHtmlIndexViewToolStripMenuItem
|
||||
//
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem.Name = "saveAllImagesWithHtmlIndexViewToolStripMenuItem";
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem.Size = new System.Drawing.Size(282, 22);
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem.Text = "Save all images with html index view...";
|
||||
this.saveAllImagesWithHtmlIndexViewToolStripMenuItem.Click += new System.EventHandler(this.saveAllImagesWithHtmlIndexViewToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparatorImageCompare
|
||||
//
|
||||
this.toolStripSeparatorImageCompare.Name = "toolStripSeparatorImageCompare";
|
||||
this.toolStripSeparatorImageCompare.Size = new System.Drawing.Size(302, 6);
|
||||
//
|
||||
// inspectImageCompareMatchesForCurrentImageToolStripMenuItem
|
||||
//
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Name = "inspectImageCompareMatchesForCurrentImageToolStripMenuItem";
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Text = "Inspect compare matches for current image";
|
||||
this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Click += new System.EventHandler(this.inspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click);
|
||||
//
|
||||
// EditLastAdditionsToolStripMenuItem
|
||||
//
|
||||
this.EditLastAdditionsToolStripMenuItem.Name = "EditLastAdditionsToolStripMenuItem";
|
||||
this.EditLastAdditionsToolStripMenuItem.Size = new System.Drawing.Size(305, 22);
|
||||
this.EditLastAdditionsToolStripMenuItem.Text = "Edit last ocr image additions...";
|
||||
this.EditLastAdditionsToolStripMenuItem.Click += new System.EventHandler(this.inspectLastAdditionsToolStripMenuItem_Click);
|
||||
//
|
||||
// labelSubtitleText
|
||||
//
|
||||
this.labelSubtitleText.AutoSize = true;
|
||||
@ -866,6 +891,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.checkBoxUseTimeCodesFromIdx.UseVisualStyleBackColor = true;
|
||||
this.checkBoxUseTimeCodesFromIdx.CheckedChanged += new System.EventHandler(this.checkBoxUseTimeCodesFromIdx_CheckedChanged);
|
||||
//
|
||||
// openFileDialog1
|
||||
//
|
||||
this.openFileDialog1.FileName = "openFileDialog1";
|
||||
//
|
||||
// subtitleListView1
|
||||
//
|
||||
this.subtitleListView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
@ -885,10 +914,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.subtitleListView1.View = System.Windows.Forms.View.Details;
|
||||
this.subtitleListView1.SelectedIndexChanged += new System.EventHandler(this.SubtitleListView1SelectedIndexChanged);
|
||||
//
|
||||
// openFileDialog1
|
||||
//
|
||||
this.openFileDialog1.FileName = "openFileDialog1";
|
||||
//
|
||||
// VobSubOcr
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -1021,5 +1046,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private System.Windows.Forms.ToolStripMenuItem importTextWithMatchingTimeCodesToolStripMenuItem;
|
||||
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveAllImagesWithHtmlIndexViewToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparatorImageCompare;
|
||||
private System.Windows.Forms.ToolStripMenuItem inspectImageCompareMatchesForCurrentImageToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem EditLastAdditionsToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
public sealed partial class VobSubOcr : Form
|
||||
{
|
||||
private class CompareItem
|
||||
internal class CompareItem
|
||||
{
|
||||
public Bitmap Bitmap { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
@ -34,20 +34,22 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
public class CompareMatch
|
||||
internal class CompareMatch
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public bool Italic { get; set; }
|
||||
public int ExpandCount { get; set; }
|
||||
public CompareMatch(string text, bool italic, int expandCount)
|
||||
public string Name { get; set; }
|
||||
public CompareMatch(string text, bool italic, int expandCount, string name)
|
||||
{
|
||||
Text = text;
|
||||
Italic = italic;
|
||||
ExpandCount = expandCount;
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
||||
public class ImageCompareAddition
|
||||
internal class ImageCompareAddition
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Text { get; set; }
|
||||
@ -119,7 +121,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
Subtitle _bdnXmlSubtitle;
|
||||
string _bdnFileName;
|
||||
|
||||
List<ImageCompareAddition> _lastAddictions = new List<ImageCompareAddition>();
|
||||
List<ImageCompareAddition> _lastAdditions = new List<ImageCompareAddition>();
|
||||
VobSubOcrCharacter _vobSubOcrCharacter = new VobSubOcrCharacter();
|
||||
|
||||
public VobSubOcr()
|
||||
@ -851,7 +853,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
if (!int.TryParse(node.Attributes["Expand"].InnerText, out expandCount))
|
||||
expandCount = 0;
|
||||
}
|
||||
return new CompareMatch(node.Attributes["Text"].InnerText, isItalic, expandCount);
|
||||
return new CompareMatch(node.Attributes["Text"].InnerText, isItalic, expandCount, _compareBitmaps[smallestIndex].Name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -863,7 +865,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
if (!int.TryParse(nodeGuess.Attributes["Expand"].InnerText, out expandCountGuess))
|
||||
expandCountGuess = 0;
|
||||
}
|
||||
secondBestGuess = new CompareMatch(nodeGuess.Attributes["Text"].InnerText, isItalicGuess, expandCountGuess);
|
||||
secondBestGuess = new CompareMatch(nodeGuess.Attributes["Text"].InnerText, isItalicGuess, expandCountGuess, _compareBitmaps[smallestIndex].Name);
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -1164,7 +1166,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
item = GetExpandedSelection(bitmap, expandSelectionList);
|
||||
|
||||
_vobSubOcrCharacter.Initialize(bitmap, item, _manualOcrDialogPosition, _italicCheckedLast, expandSelectionList.Count > 1, null, _lastAddictions, this);
|
||||
_vobSubOcrCharacter.Initialize(bitmap, item, _manualOcrDialogPosition, _italicCheckedLast, expandSelectionList.Count > 1, null, _lastAdditions, this);
|
||||
DialogResult result = _vobSubOcrCharacter.ShowDialog(this);
|
||||
_manualOcrDialogPosition = _vobSubOcrCharacter.FormPosition;
|
||||
if (result == DialogResult.OK && _vobSubOcrCharacter.ShrinkSelection)
|
||||
@ -1183,8 +1185,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string text = _vobSubOcrCharacter.ManualRecognizedCharacters;
|
||||
string name = SaveCompareItem(item.Bitmap, text, _vobSubOcrCharacter.IsItalic, expandSelectionList.Count);
|
||||
var addition = new ImageCompareAddition(name, text, item.Bitmap, _vobSubOcrCharacter.IsItalic, listViewIndex);
|
||||
_lastAddictions.Add(addition);
|
||||
matches.Add(new CompareMatch(text, _vobSubOcrCharacter.IsItalic, expandSelectionList.Count));
|
||||
_lastAdditions.Add(addition);
|
||||
matches.Add(new CompareMatch(text, _vobSubOcrCharacter.IsItalic, expandSelectionList.Count, null));
|
||||
expandSelectionList = new List<ImageSplitterItem>();
|
||||
}
|
||||
else if (result == DialogResult.Abort)
|
||||
@ -1193,14 +1195,14 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
matches.Add(new CompareMatch("*", false, 0));
|
||||
matches.Add(new CompareMatch("*", false, 0, null));
|
||||
}
|
||||
_italicCheckedLast = _vobSubOcrCharacter.IsItalic;
|
||||
|
||||
}
|
||||
else if (item.Bitmap == null)
|
||||
{
|
||||
matches.Add(new CompareMatch(item.SpecialCharacter, false, 0));
|
||||
matches.Add(new CompareMatch(item.SpecialCharacter, false, 0, null));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1208,7 +1210,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
CompareMatch match = GetCompareMatch(item, bitmap, out bestGuess);
|
||||
if (match == null)
|
||||
{
|
||||
_vobSubOcrCharacter.Initialize(bitmap, item, _manualOcrDialogPosition, _italicCheckedLast, false, bestGuess, _lastAddictions, this);
|
||||
_vobSubOcrCharacter.Initialize(bitmap, item, _manualOcrDialogPosition, _italicCheckedLast, false, bestGuess, _lastAdditions, this);
|
||||
DialogResult result = _vobSubOcrCharacter.ShowDialog(this);
|
||||
_manualOcrDialogPosition = _vobSubOcrCharacter.FormPosition;
|
||||
if (result == DialogResult.OK && _vobSubOcrCharacter.ExpandSelection)
|
||||
@ -1221,8 +1223,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string text = _vobSubOcrCharacter.ManualRecognizedCharacters;
|
||||
string name = SaveCompareItem(item.Bitmap, text, _vobSubOcrCharacter.IsItalic, 0);
|
||||
var addition = new ImageCompareAddition(name, text, item.Bitmap, _vobSubOcrCharacter.IsItalic, listViewIndex);
|
||||
_lastAddictions.Add(addition);
|
||||
matches.Add(new CompareMatch(text, _vobSubOcrCharacter.IsItalic, 0));
|
||||
_lastAdditions.Add(addition);
|
||||
matches.Add(new CompareMatch(text, _vobSubOcrCharacter.IsItalic, 0, null));
|
||||
}
|
||||
else if (result == DialogResult.Abort)
|
||||
{
|
||||
@ -1230,13 +1232,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
matches.Add(new CompareMatch("*", false, 0));
|
||||
matches.Add(new CompareMatch("*", false, 0, null));
|
||||
}
|
||||
_italicCheckedLast = _vobSubOcrCharacter.IsItalic;
|
||||
}
|
||||
else // found image match
|
||||
{
|
||||
matches.Add(new CompareMatch(match.Text, match.Italic, 0));
|
||||
matches.Add(new CompareMatch(match.Text, match.Italic, 0, null));
|
||||
if (match.ExpandCount > 0)
|
||||
index += match.ExpandCount - 1;
|
||||
}
|
||||
@ -2103,7 +2105,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
public DialogResult EditImageCompareCharacters(string name, string text)
|
||||
{
|
||||
var formVobSubEditCharacters = new VobSubEditCharacters(comboBoxCharacterDatabase.SelectedItem.ToString());
|
||||
var formVobSubEditCharacters = new VobSubEditCharacters(comboBoxCharacterDatabase.SelectedItem.ToString(), null);
|
||||
formVobSubEditCharacters.Initialize(name, text);
|
||||
|
||||
DialogResult result = formVobSubEditCharacters.ShowDialog();
|
||||
@ -2271,7 +2273,18 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
saveImageAsToolStripMenuItem.Visible = true;
|
||||
}
|
||||
|
||||
|
||||
if (comboBoxOcrMethod.SelectedIndex == 1) // image compare
|
||||
{
|
||||
toolStripSeparatorImageCompare.Visible = true;
|
||||
inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Visible = true;
|
||||
EditLastAdditionsToolStripMenuItem.Visible = _lastAdditions != null && _lastAdditions.Count > 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
toolStripSeparatorImageCompare.Visible = false;
|
||||
inspectImageCompareMatchesForCurrentImageToolStripMenuItem.Visible = false;
|
||||
EditLastAdditionsToolStripMenuItem.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveImageAsToolStripMenuItemClick(object sender, EventArgs e)
|
||||
@ -2569,9 +2582,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
internal void StartOcrFromDelayed()
|
||||
{
|
||||
if (_lastAddictions.Count > 0)
|
||||
if (_lastAdditions.Count > 0)
|
||||
{
|
||||
var last = _lastAddictions[_lastAddictions.Count - 1];
|
||||
var last = _lastAdditions[_lastAdditions.Count - 1];
|
||||
numericUpDownStartNumber.Value = last.Index + 1;
|
||||
Timer t = new Timer();
|
||||
t.Interval = 200;
|
||||
@ -2684,5 +2697,67 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void inspectImageCompareMatchesForCurrentImageToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (subtitleListView1.SelectedItems.Count != 1)
|
||||
return;
|
||||
|
||||
Cursor = Cursors.WaitCursor;
|
||||
Bitmap bitmap = GetSubtitleBitmap(subtitleListView1.SelectedItems[0].Index);
|
||||
var matches = new List<CompareMatch>();
|
||||
List<ImageSplitterItem> list = ImageSplitter.SplitBitmapToLetters(bitmap, (int)numericUpDownPixelsIsSpace.Value, checkBoxRightToLeft.Checked, Configuration.Settings.VobSubOcr.TopToBottom);
|
||||
int index = 0;
|
||||
var imageSources = new List<Bitmap>();
|
||||
while (index < list.Count)
|
||||
{
|
||||
ImageSplitterItem item = list[index];
|
||||
if (item.Bitmap == null)
|
||||
{
|
||||
matches.Add(new CompareMatch(item.SpecialCharacter, false, 0, null));
|
||||
imageSources.Add(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
CompareMatch bestGuess;
|
||||
CompareMatch match = GetCompareMatch(item, bitmap, out bestGuess);
|
||||
if (match == null)
|
||||
{
|
||||
matches.Add(new CompareMatch(Configuration.Settings.Language.VobSubOcr.NoMatch, false, 0, null));
|
||||
imageSources.Add(item.Bitmap);
|
||||
}
|
||||
else // found image match
|
||||
{
|
||||
matches.Add(new CompareMatch(match.Text, match.Italic, 0, match.Name));
|
||||
imageSources.Add(item.Bitmap);
|
||||
if (match.ExpandCount > 0)
|
||||
index += match.ExpandCount - 1;
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
VobSubOcrCharacterInspect inspect = new VobSubOcrCharacterInspect();
|
||||
inspect.Initialize(comboBoxCharacterDatabase.SelectedItem.ToString(), matches, imageSources);
|
||||
if (inspect.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
_compareDoc = inspect.ImageCompareDocument;
|
||||
string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
|
||||
_compareDoc.Save(path + "CompareDescription.xml");
|
||||
}
|
||||
}
|
||||
|
||||
private void inspectLastAdditionsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
VobSubEditCharacters formVobSubEditCharacters = new VobSubEditCharacters(comboBoxCharacterDatabase.SelectedItem.ToString(), _lastAdditions);
|
||||
if (formVobSubEditCharacters.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
_lastAdditions = formVobSubEditCharacters.Additions;
|
||||
_compareDoc = formVobSubEditCharacters.ImageCompareDocument;
|
||||
string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
|
||||
_compareDoc.Save(path + "CompareDescription.xml");
|
||||
}
|
||||
LoadImageCompareBitmaps();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
public bool ShrinkSelection { get; private set; }
|
||||
|
||||
public void Initialize(Bitmap vobSubImage, ImageSplitterItem character, Point position, bool italicChecked, bool showShrink, VobSubOcr.CompareMatch bestGuess, List<VobSubOcr.ImageCompareAddition> additions, VobSubOcr vobSubForm)
|
||||
internal void Initialize(Bitmap vobSubImage, ImageSplitterItem character, Point position, bool italicChecked, bool showShrink, VobSubOcr.CompareMatch bestGuess, List<VobSubOcr.ImageCompareAddition> additions, VobSubOcr vobSubForm)
|
||||
{
|
||||
ShrinkSelection = false;
|
||||
ExpandSelection = false;
|
||||
@ -202,7 +202,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private void InsertLanguageCharacter(object sender, EventArgs e)
|
||||
{
|
||||
textBoxCharacters.Text = textBoxCharacters.Text.Insert(textBoxCharacters.SelectionStart, (sender as ToolStripMenuItem).Text);
|
||||
|
||||
}
|
||||
|
||||
private void textBoxCharacters_TextChanged(object sender, EventArgs e)
|
||||
|
246
src/Forms/VobSubOcrCharacterInspect.Designer.cs
generated
Normal file
246
src/Forms/VobSubOcrCharacterInspect.Designer.cs
generated
Normal file
@ -0,0 +1,246 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
partial class VobSubOcrCharacterInspect
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.groupBoxCurrentCompareImage = new System.Windows.Forms.GroupBox();
|
||||
this.checkBoxItalic = new System.Windows.Forms.CheckBox();
|
||||
this.labelDoubleSize = new System.Windows.Forms.Label();
|
||||
this.pictureBoxCompareBitmapDouble = new System.Windows.Forms.PictureBox();
|
||||
this.labelTextAssociatedWithImage = new System.Windows.Forms.Label();
|
||||
this.buttonDelete = new System.Windows.Forms.Button();
|
||||
this.buttonUpdate = new System.Windows.Forms.Button();
|
||||
this.labelImageInfo = new System.Windows.Forms.Label();
|
||||
this.textBoxText = new System.Windows.Forms.TextBox();
|
||||
this.pictureBoxCompareBitmap = new System.Windows.Forms.PictureBox();
|
||||
this.buttonOK = new System.Windows.Forms.Button();
|
||||
this.listBoxInspectItems = new System.Windows.Forms.ListBox();
|
||||
this.groupBoxInspectItems = new System.Windows.Forms.GroupBox();
|
||||
this.pictureBoxInspectItem = new System.Windows.Forms.PictureBox();
|
||||
this.groupBoxCurrentCompareImage.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCompareBitmapDouble)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCompareBitmap)).BeginInit();
|
||||
this.groupBoxInspectItems.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxInspectItem)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonCancel.Location = new System.Drawing.Point(634, 286);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
|
||||
this.buttonCancel.TabIndex = 8;
|
||||
this.buttonCancel.Text = "C&ancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBoxCurrentCompareImage
|
||||
//
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.checkBoxItalic);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.labelDoubleSize);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.pictureBoxCompareBitmapDouble);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.labelTextAssociatedWithImage);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.buttonDelete);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.buttonUpdate);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.labelImageInfo);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.textBoxText);
|
||||
this.groupBoxCurrentCompareImage.Controls.Add(this.pictureBoxCompareBitmap);
|
||||
this.groupBoxCurrentCompareImage.Location = new System.Drawing.Point(443, 12);
|
||||
this.groupBoxCurrentCompareImage.Name = "groupBoxCurrentCompareImage";
|
||||
this.groupBoxCurrentCompareImage.Size = new System.Drawing.Size(266, 268);
|
||||
this.groupBoxCurrentCompareImage.TabIndex = 11;
|
||||
this.groupBoxCurrentCompareImage.TabStop = false;
|
||||
this.groupBoxCurrentCompareImage.Text = "Current compare image";
|
||||
//
|
||||
// checkBoxItalic
|
||||
//
|
||||
this.checkBoxItalic.AutoSize = true;
|
||||
this.checkBoxItalic.Location = new System.Drawing.Point(15, 61);
|
||||
this.checkBoxItalic.Name = "checkBoxItalic";
|
||||
this.checkBoxItalic.Size = new System.Drawing.Size(58, 17);
|
||||
this.checkBoxItalic.TabIndex = 2;
|
||||
this.checkBoxItalic.Text = "Is &italic";
|
||||
this.checkBoxItalic.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// labelDoubleSize
|
||||
//
|
||||
this.labelDoubleSize.AutoSize = true;
|
||||
this.labelDoubleSize.Location = new System.Drawing.Point(14, 172);
|
||||
this.labelDoubleSize.Name = "labelDoubleSize";
|
||||
this.labelDoubleSize.Size = new System.Drawing.Size(92, 13);
|
||||
this.labelDoubleSize.TabIndex = 6;
|
||||
this.labelDoubleSize.Text = "Image double size";
|
||||
//
|
||||
// pictureBoxCompareBitmapDouble
|
||||
//
|
||||
this.pictureBoxCompareBitmapDouble.BackColor = System.Drawing.Color.Red;
|
||||
this.pictureBoxCompareBitmapDouble.Location = new System.Drawing.Point(17, 188);
|
||||
this.pictureBoxCompareBitmapDouble.Name = "pictureBoxCompareBitmapDouble";
|
||||
this.pictureBoxCompareBitmapDouble.Size = new System.Drawing.Size(66, 73);
|
||||
this.pictureBoxCompareBitmapDouble.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBoxCompareBitmapDouble.TabIndex = 27;
|
||||
this.pictureBoxCompareBitmapDouble.TabStop = false;
|
||||
//
|
||||
// labelTextAssociatedWithImage
|
||||
//
|
||||
this.labelTextAssociatedWithImage.AutoSize = true;
|
||||
this.labelTextAssociatedWithImage.Location = new System.Drawing.Point(14, 19);
|
||||
this.labelTextAssociatedWithImage.Name = "labelTextAssociatedWithImage";
|
||||
this.labelTextAssociatedWithImage.Size = new System.Drawing.Size(135, 13);
|
||||
this.labelTextAssociatedWithImage.TabIndex = 0;
|
||||
this.labelTextAssociatedWithImage.Text = "Text associated with image";
|
||||
//
|
||||
// buttonDelete
|
||||
//
|
||||
this.buttonDelete.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonDelete.Location = new System.Drawing.Point(120, 62);
|
||||
this.buttonDelete.Name = "buttonDelete";
|
||||
this.buttonDelete.Size = new System.Drawing.Size(88, 21);
|
||||
this.buttonDelete.TabIndex = 4;
|
||||
this.buttonDelete.Text = "Delete ";
|
||||
this.buttonDelete.UseVisualStyleBackColor = true;
|
||||
this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click);
|
||||
//
|
||||
// buttonUpdate
|
||||
//
|
||||
this.buttonUpdate.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonUpdate.Location = new System.Drawing.Point(120, 35);
|
||||
this.buttonUpdate.Name = "buttonUpdate";
|
||||
this.buttonUpdate.Size = new System.Drawing.Size(88, 21);
|
||||
this.buttonUpdate.TabIndex = 3;
|
||||
this.buttonUpdate.Text = "Update";
|
||||
this.buttonUpdate.UseVisualStyleBackColor = true;
|
||||
this.buttonUpdate.Click += new System.EventHandler(this.buttonUpdate_Click);
|
||||
//
|
||||
// labelImageInfo
|
||||
//
|
||||
this.labelImageInfo.AutoSize = true;
|
||||
this.labelImageInfo.Location = new System.Drawing.Point(12, 87);
|
||||
this.labelImageInfo.Name = "labelImageInfo";
|
||||
this.labelImageInfo.Size = new System.Drawing.Size(35, 13);
|
||||
this.labelImageInfo.TabIndex = 5;
|
||||
this.labelImageInfo.Text = "label1";
|
||||
//
|
||||
// textBoxText
|
||||
//
|
||||
this.textBoxText.Location = new System.Drawing.Point(14, 35);
|
||||
this.textBoxText.Name = "textBoxText";
|
||||
this.textBoxText.Size = new System.Drawing.Size(100, 20);
|
||||
this.textBoxText.TabIndex = 1;
|
||||
//
|
||||
// pictureBoxCompareBitmap
|
||||
//
|
||||
this.pictureBoxCompareBitmap.BackColor = System.Drawing.Color.Red;
|
||||
this.pictureBoxCompareBitmap.Location = new System.Drawing.Point(17, 104);
|
||||
this.pictureBoxCompareBitmap.Name = "pictureBoxCompareBitmap";
|
||||
this.pictureBoxCompareBitmap.Size = new System.Drawing.Size(52, 52);
|
||||
this.pictureBoxCompareBitmap.TabIndex = 22;
|
||||
this.pictureBoxCompareBitmap.TabStop = false;
|
||||
//
|
||||
// buttonOK
|
||||
//
|
||||
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonOK.Location = new System.Drawing.Point(553, 286);
|
||||
this.buttonOK.Name = "buttonOK";
|
||||
this.buttonOK.Size = new System.Drawing.Size(75, 21);
|
||||
this.buttonOK.TabIndex = 7;
|
||||
this.buttonOK.Text = "&OK";
|
||||
this.buttonOK.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// listBoxInspectItems
|
||||
//
|
||||
this.listBoxInspectItems.FormattingEnabled = true;
|
||||
this.listBoxInspectItems.Location = new System.Drawing.Point(6, 19);
|
||||
this.listBoxInspectItems.Name = "listBoxInspectItems";
|
||||
this.listBoxInspectItems.Size = new System.Drawing.Size(240, 238);
|
||||
this.listBoxInspectItems.TabIndex = 12;
|
||||
this.listBoxInspectItems.SelectedIndexChanged += new System.EventHandler(this.listBoxInspectItems_SelectedIndexChanged);
|
||||
//
|
||||
// groupBoxInspectItems
|
||||
//
|
||||
this.groupBoxInspectItems.Controls.Add(this.pictureBoxInspectItem);
|
||||
this.groupBoxInspectItems.Controls.Add(this.listBoxInspectItems);
|
||||
this.groupBoxInspectItems.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBoxInspectItems.Name = "groupBoxInspectItems";
|
||||
this.groupBoxInspectItems.Size = new System.Drawing.Size(425, 268);
|
||||
this.groupBoxInspectItems.TabIndex = 13;
|
||||
this.groupBoxInspectItems.TabStop = false;
|
||||
this.groupBoxInspectItems.Text = "Inspect items";
|
||||
//
|
||||
// pictureBoxInspectItem
|
||||
//
|
||||
this.pictureBoxInspectItem.BackColor = System.Drawing.Color.Red;
|
||||
this.pictureBoxInspectItem.Location = new System.Drawing.Point(252, 114);
|
||||
this.pictureBoxInspectItem.Name = "pictureBoxInspectItem";
|
||||
this.pictureBoxInspectItem.Size = new System.Drawing.Size(52, 52);
|
||||
this.pictureBoxInspectItem.TabIndex = 23;
|
||||
this.pictureBoxInspectItem.TabStop = false;
|
||||
//
|
||||
// VobSubOcrCharacterInspect
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(722, 323);
|
||||
this.Controls.Add(this.groupBoxInspectItems);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.groupBoxCurrentCompareImage);
|
||||
this.Controls.Add(this.buttonOK);
|
||||
this.Name = "VobSubOcrCharacterInspect";
|
||||
this.Text = "VobSubOcrCharacterInspect";
|
||||
this.groupBoxCurrentCompareImage.ResumeLayout(false);
|
||||
this.groupBoxCurrentCompareImage.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCompareBitmapDouble)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCompareBitmap)).EndInit();
|
||||
this.groupBoxInspectItems.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxInspectItem)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.GroupBox groupBoxCurrentCompareImage;
|
||||
private System.Windows.Forms.CheckBox checkBoxItalic;
|
||||
private System.Windows.Forms.Label labelDoubleSize;
|
||||
private System.Windows.Forms.PictureBox pictureBoxCompareBitmapDouble;
|
||||
private System.Windows.Forms.Label labelTextAssociatedWithImage;
|
||||
private System.Windows.Forms.Button buttonDelete;
|
||||
private System.Windows.Forms.Button buttonUpdate;
|
||||
private System.Windows.Forms.Label labelImageInfo;
|
||||
private System.Windows.Forms.TextBox textBoxText;
|
||||
private System.Windows.Forms.PictureBox pictureBoxCompareBitmap;
|
||||
private System.Windows.Forms.Button buttonOK;
|
||||
private System.Windows.Forms.ListBox listBoxInspectItems;
|
||||
private System.Windows.Forms.GroupBox groupBoxInspectItems;
|
||||
private System.Windows.Forms.PictureBox pictureBoxInspectItem;
|
||||
}
|
||||
}
|
159
src/Forms/VobSubOcrCharacterInspect.cs
Normal file
159
src/Forms/VobSubOcrCharacterInspect.cs
Normal file
@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
public partial class VobSubOcrCharacterInspect : Form
|
||||
{
|
||||
|
||||
public XmlDocument ImageCompareDocument { get; private set; }
|
||||
private List<VobSubOcr.CompareMatch> _matches;
|
||||
private List<Bitmap> _imageSources;
|
||||
private string _directoryPath;
|
||||
private XmlNode _selectedCompareNode = null;
|
||||
|
||||
public VobSubOcrCharacterInspect()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Text = Configuration.Settings.Language.VobSubOcrCharacterInspect.Title;
|
||||
groupBoxInspectItems.Text = Configuration.Settings.Language.VobSubOcrCharacterInspect.InspectItems;
|
||||
|
||||
groupBoxCurrentCompareImage.Text = Configuration.Settings.Language.VobSubEditCharacters.CurrentCompareImage;
|
||||
labelTextAssociatedWithImage.Text = Configuration.Settings.Language.VobSubEditCharacters.TextAssociatedWithImage;
|
||||
checkBoxItalic.Text = Configuration.Settings.Language.VobSubEditCharacters.IsItalic;
|
||||
buttonUpdate.Text = Configuration.Settings.Language.VobSubEditCharacters.Update;
|
||||
buttonDelete.Text = Configuration.Settings.Language.VobSubEditCharacters.Delete;
|
||||
labelDoubleSize.Text = Configuration.Settings.Language.VobSubEditCharacters.ImageDoubleSize;
|
||||
buttonOK.Text = Configuration.Settings.Language.General.OK;
|
||||
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
|
||||
FixLargeFonts();
|
||||
}
|
||||
|
||||
private void FixLargeFonts()
|
||||
{
|
||||
Graphics graphics = this.CreateGraphics();
|
||||
SizeF textSize = graphics.MeasureString(buttonOK.Text, this.Font);
|
||||
if (textSize.Height > buttonOK.Height - 4)
|
||||
{
|
||||
int newButtonHeight = (int)(textSize.Height + 7 + 0.5);
|
||||
Utilities.SetButtonHeight(this, newButtonHeight, 1);
|
||||
}
|
||||
}
|
||||
|
||||
internal void Initialize(string databaseFolderName, List<VobSubOcr.CompareMatch> matches, List<Bitmap> imageSources)
|
||||
{
|
||||
_matches = matches;
|
||||
_imageSources = imageSources;
|
||||
|
||||
ImageCompareDocument = new XmlDocument();
|
||||
_directoryPath = Configuration.VobSubCompareFolder + databaseFolderName + Path.DirectorySeparatorChar;
|
||||
if (!File.Exists(_directoryPath + "CompareDescription.xml"))
|
||||
ImageCompareDocument.LoadXml("<OcrBitmaps></OcrBitmaps>");
|
||||
else
|
||||
ImageCompareDocument.Load(_directoryPath + "CompareDescription.xml");
|
||||
|
||||
for (int i = 0; i < _matches.Count; i++)
|
||||
{
|
||||
listBoxInspectItems.Items.Add(_matches[i].Text);
|
||||
}
|
||||
if (listBoxInspectItems.Items.Count > 0)
|
||||
listBoxInspectItems.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void listBoxInspectItems_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (listBoxInspectItems.SelectedIndex < 0)
|
||||
return;
|
||||
|
||||
_selectedCompareNode = null;
|
||||
pictureBoxInspectItem.Image = _imageSources[listBoxInspectItems.SelectedIndex];
|
||||
pictureBoxCompareBitmap.Image = null;
|
||||
pictureBoxCompareBitmapDouble.Image = null;
|
||||
|
||||
int index = (listBoxInspectItems.SelectedIndex);
|
||||
var match = _matches[index];
|
||||
if (!string.IsNullOrEmpty(match.Name))
|
||||
{
|
||||
foreach (XmlNode node in ImageCompareDocument.DocumentElement.ChildNodes)
|
||||
{
|
||||
if (node.Attributes["Text"] != null && node.InnerText == match.Name)
|
||||
{
|
||||
string text = node.Attributes["Text"].InnerText;
|
||||
string imageFileName = node.InnerText + ".bmp";
|
||||
imageFileName = Path.Combine(_directoryPath, imageFileName);
|
||||
textBoxText.Text = text;
|
||||
checkBoxItalic.Checked = node.Attributes["Italic"] != null;
|
||||
Bitmap bitmap = new Bitmap(imageFileName);
|
||||
pictureBoxCompareBitmap.Image = bitmap;
|
||||
pictureBoxCompareBitmapDouble.Width = bitmap.Width * 2;
|
||||
pictureBoxCompareBitmapDouble.Height = bitmap.Height * 2;
|
||||
pictureBoxCompareBitmapDouble.Image = bitmap;
|
||||
_selectedCompareNode = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_selectedCompareNode == null)
|
||||
{
|
||||
buttonUpdate.Enabled = false;
|
||||
buttonDelete.Enabled = false;
|
||||
textBoxText.Enabled = false;
|
||||
textBoxText.Text = string.Empty;
|
||||
checkBoxItalic.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
buttonUpdate.Enabled = true;
|
||||
buttonDelete.Enabled = true;
|
||||
textBoxText.Enabled = true;
|
||||
checkBoxItalic.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedCompareNode == null)
|
||||
return;
|
||||
|
||||
XmlNode node = _selectedCompareNode;
|
||||
string newText = textBoxText.Text;
|
||||
listBoxInspectItems.Items[listBoxInspectItems.SelectedIndex] = newText;
|
||||
node.Attributes["Text"].InnerText = newText;
|
||||
|
||||
if (checkBoxItalic.Checked)
|
||||
{
|
||||
if (node.Attributes["Italic"] == null)
|
||||
{
|
||||
XmlAttribute italic = node.OwnerDocument.CreateAttribute("Italic");
|
||||
italic.InnerText = "true";
|
||||
node.Attributes.Append(italic);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node.Attributes["Italic"] != null)
|
||||
{
|
||||
node.Attributes.RemoveNamedItem("Italic");
|
||||
}
|
||||
}
|
||||
listBoxInspectItems_SelectedIndexChanged(null, null);
|
||||
}
|
||||
|
||||
private void buttonDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_selectedCompareNode == null)
|
||||
return;
|
||||
listBoxInspectItems.Items[listBoxInspectItems.SelectedIndex] = Configuration.Settings.Language.VobSubOcr.NoMatch;
|
||||
ImageCompareDocument.DocumentElement.RemoveChild(_selectedCompareNode);
|
||||
_selectedCompareNode = null;
|
||||
listBoxInspectItems_SelectedIndexChanged(null, null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
120
src/Forms/VobSubOcrCharacterInspect.resx
Normal file
120
src/Forms/VobSubOcrCharacterInspect.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -63,6 +63,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public LanguageStructure.VobSubEditCharacters VobSubEditCharacters;
|
||||
public LanguageStructure.VobSubOcr VobSubOcr;
|
||||
public LanguageStructure.VobSubOcrCharacter VobSubOcrCharacter;
|
||||
public LanguageStructure.VobSubOcrCharacterInspect VobSubOcrCharacterInspect;
|
||||
public LanguageStructure.VobSubOcrNewFolder VobSubOcrNewFolder;
|
||||
public LanguageStructure.WaveForm WaveForm;
|
||||
|
||||
@ -1424,6 +1425,7 @@ can edit in same subtitle file (collaboration)",
|
||||
RightToLeft = "Right to left",
|
||||
ShowOnlyForcedSubtitles = "Show only forced subtitles",
|
||||
UseTimeCodesFromIdx = "Use time codes from .idx file",
|
||||
NoMatch = "<No match>",
|
||||
};
|
||||
|
||||
VobSubOcrCharacter = new LanguageStructure.VobSubOcrCharacter
|
||||
@ -1444,6 +1446,13 @@ can edit in same subtitle file (collaboration)",
|
||||
EditLastX = "Edit last: {0}",
|
||||
};
|
||||
|
||||
VobSubOcrCharacterInspect = new LanguageStructure.VobSubOcrCharacterInspect
|
||||
{
|
||||
Title = "Inspect compare matches for current image",
|
||||
InspectItems = "Inspect items",
|
||||
};
|
||||
|
||||
|
||||
VobSubOcrNewFolder = new LanguageStructure.VobSubOcrNewFolder
|
||||
{
|
||||
Title = "New folder",
|
||||
|
@ -1354,7 +1354,8 @@
|
||||
public string DictionaryX { get; set; }
|
||||
public string RightToLeft { get; set; }
|
||||
public string ShowOnlyForcedSubtitles { get; set; }
|
||||
public string UseTimeCodesFromIdx { get; set; }
|
||||
public string UseTimeCodesFromIdx { get; set; }
|
||||
public string NoMatch { get; set; }
|
||||
}
|
||||
|
||||
public class VobSubOcrCharacter
|
||||
@ -1375,6 +1376,12 @@
|
||||
public string EditLastX { get; set; }
|
||||
}
|
||||
|
||||
public class VobSubOcrCharacterInspect
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string InspectItems { get; set; }
|
||||
}
|
||||
|
||||
public class VobSubOcrNewFolder
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
@ -431,6 +431,12 @@
|
||||
<Compile Include="Forms\VobSubOcrCharacter.Designer.cs">
|
||||
<DependentUpon>VobSubOcrCharacter.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\VobSubOcrCharacterInspect.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\VobSubOcrCharacterInspect.Designer.cs">
|
||||
<DependentUpon>VobSubOcrCharacterInspect.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\VobSubOcrNewFolder.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -815,6 +821,9 @@
|
||||
<DependentUpon>VobSubOcrCharacter.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\VobSubOcrCharacterInspect.resx">
|
||||
<DependentUpon>VobSubOcrCharacterInspect.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\VobSubOcrNewFolder.resx">
|
||||
<DependentUpon>VobSubOcrNewFolder.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
|
Loading…
Reference in New Issue
Block a user