本文整理汇总了C#中Nikse.SubtitleEdit.Forms.ExportPngXml.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# ExportPngXml.Initialize方法的具体用法?C# ExportPngXml.Initialize怎么用?C# ExportPngXml.Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nikse.SubtitleEdit.Forms.ExportPngXml
的用法示例。
在下文中一共展示了ExportPngXml.Initialize方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: toolStripMenuItemExportEdlClick
private void toolStripMenuItemExportEdlClick(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(_subtitle, GetCurrentSubtitleFormat(), "EDL", _fileName, _videoInfo, _videoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例2: AdobeEncoreFabImageScriptToolStripMenuItemClick
private void AdobeEncoreFabImageScriptToolStripMenuItemClick(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(_subtitle, GetCurrentSubtitleFormat(), "FAB", _fileName, _videoInfo, _videoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例3: DvdStudioProStl_Click
private void DvdStudioProStl_Click(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(_subtitle, GetCurrentSubtitleFormat(), "STL", _fileName, _videoInfo, _videoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例4: toolStripMenuItem2_Click
private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
var exportBdnXmlPng = new ExportPngXml();
exportBdnXmlPng.Initialize(_subtitle, GetCurrentSubtitleFormat(), "SPUMUX", _fileName, _videoInfo);
_formPositionsAndSizes.SetPositionAndSize(exportBdnXmlPng);
exportBdnXmlPng.ShowDialog(this);
_formPositionsAndSizes.SavePositionAndSize(exportBdnXmlPng);
}
示例5: toolStripMenuItemDost_Click
private void toolStripMenuItemDost_Click(object sender, EventArgs e)
{
var exportBdnXmlPng = new ExportPngXml();
exportBdnXmlPng.Initialize(_subtitle, GetCurrentSubtitleFormat(), "DOST", _fileName, _videoInfo);
exportBdnXmlPng.ShowDialog(this);
}
示例6: BluraySupToolStripMenuItemClick
private void BluraySupToolStripMenuItemClick(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(this._subtitle, this.GetCurrentSubtitleFormat(), "BLURAYSUP", this._fileName, this._videoInfo, this.VideoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例7: ToolStripMenuItemImagePerFrameClick
private void ToolStripMenuItemImagePerFrameClick(object sender, EventArgs e)
{
var exportBdnXmlPng = new ExportPngXml();
exportBdnXmlPng.Initialize(_subtitle, GetCurrentSubtitleFormat(), "IMAGE/FRAME", _fileName, _videoInfo);
exportBdnXmlPng.ShowDialog(this);
}
示例8: toolStripMenuItemExportDcinemaInteropClick
private void toolStripMenuItemExportDcinemaInteropClick(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(this._subtitle, this.GetCurrentSubtitleFormat(), "DCINEMA_INTEROP", this._fileName, this._videoInfo, this.VideoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例9: ToolStripMenuItemImagePerFrameClick
private void ToolStripMenuItemImagePerFrameClick(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(this._subtitle, this.GetCurrentSubtitleFormat(), "IMAGE/FRAME", this._fileName, this._videoInfo, this.VideoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例10: ShowBluraySettings
private void ShowBluraySettings()
{
using (var properties = new ExportPngXml())
{
var s = new Subtitle();
s.Paragraphs.Add(new Paragraph("Test 123." + Environment.NewLine + "Test 456.", 0, 4000));
properties.Initialize(s, new SubRip(), "BLURAYSUP", null, null, null);
properties.DisableSaveButtonAndCheckBoxes();
properties.ShowDialog(this);
}
}
示例11: BatchConvertSave
//.........这里部分代码省略.........
targetFormatFound = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, pac.Extension, outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
pac.Save(outputFileName, sub);
Console.WriteLine(" done.");
}
}
if (!targetFormatFound)
{
var cavena890 = new Cavena890();
if (cavena890.Name.Replace(" ", string.Empty).Equals(toFormat, StringComparison.OrdinalIgnoreCase))
{
targetFormatFound = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, cavena890.Extension, outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
cavena890.Save(outputFileName, sub);
Console.WriteLine(" done.");
}
}
if (!targetFormatFound)
{
var cheetahCaption = new CheetahCaption();
if (cheetahCaption.Name.Replace(" ", string.Empty).Equals(toFormat, StringComparison.OrdinalIgnoreCase))
{
targetFormatFound = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, cheetahCaption.Extension, outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
CheetahCaption.Save(outputFileName, sub);
Console.WriteLine(" done.");
}
}
if (!targetFormatFound)
{
var capMakerPlus = new CapMakerPlus();
if (capMakerPlus.Name.Replace(" ", string.Empty).Equals(toFormat, StringComparison.OrdinalIgnoreCase))
{
targetFormatFound = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, capMakerPlus.Extension, outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
CapMakerPlus.Save(outputFileName, sub);
Console.WriteLine(" done.");
}
}
if (!targetFormatFound)
{
if (Configuration.Settings.Language.BatchConvert.PlainText == toFormat || Configuration.Settings.Language.BatchConvert.PlainText.Replace(" ", string.Empty).Equals(toFormat.Replace(" ", string.Empty), StringComparison.OrdinalIgnoreCase))
{
targetFormatFound = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, ".txt", outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
File.WriteAllText(outputFileName, ExportText.GeneratePlainText(sub, false, false, false, false, false, false, string.Empty, true, false, true, true, false), targetEncoding);
Console.WriteLine(" done.");
}
}
if (!targetFormatFound)
{
if (string.Compare(BatchConvert.BluRaySubtitle, toFormat, StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(BatchConvert.BluRaySubtitle.Replace(" ", string.Empty), toFormat, StringComparison.OrdinalIgnoreCase) == 0)
{
targetFormatFound = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, ".sup", outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
using (var form = new ExportPngXml())
{
form.Initialize(sub, format, "BLURAYSUP", fileName, null, null);
var binarySubtitleFile = new FileStream(outputFileName, FileMode.Create);
int width = 1920;
int height = 1080;
var parts = Configuration.Settings.Tools.ExportBluRayVideoResolution.Split('x');
if (parts.Length == 2 && Utilities.IsInteger(parts[0]) && Utilities.IsInteger(parts[1]))
{
width = int.Parse(parts[0]);
height = int.Parse(parts[1]);
}
for (int index = 0; index < sub.Paragraphs.Count; index++)
{
var mp = form.MakeMakeBitmapParameter(index, width, height);
mp.LineJoin = Configuration.Settings.Tools.ExportPenLineJoin;
mp.Bitmap = ExportPngXml.GenerateImageFromTextWithStyle(mp);
ExportPngXml.MakeBluRaySupImage(mp);
binarySubtitleFile.Write(mp.Buffer, 0, mp.Buffer.Length);
}
binarySubtitleFile.Close();
}
Console.WriteLine(" done.");
}
}
if (!targetFormatFound)
{
Console.WriteLine("{0}: {1} - target format '{2}' not found!", count, fileName, toFormat);
errors++;
return false;
}
converted++;
return true;
}
finally
{
Configuration.Settings.General.CurrentFrameRate = oldFrameRate;
}
}
示例12: toolStripMenuItemExportFcpIImage_Click
/// <summary>
/// The tool strip menu item export fcp i image_ click.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The e.
/// </param>
private void toolStripMenuItemExportFcpIImage_Click(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(this._subtitle, this.GetCurrentSubtitleFormat(), "FCP", this._fileName, this._videoInfo, this._videoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例13: ExportToEdlWithClipName
private void ExportToEdlWithClipName(object sender, EventArgs e)
{
using (var exportBdnXmlPng = new ExportPngXml())
{
exportBdnXmlPng.Initialize(_subtitle, GetCurrentSubtitleFormat(), "EDL_CLIPNAME", _fileName, _videoInfo, _videoFileName);
exportBdnXmlPng.ShowDialog(this);
}
}
示例14: BatchConvertSave
internal static bool BatchConvertSave(string targetFormat, string offset, Encoding targetEncoding, string outputFolder, int count, ref int converted, ref int errors, IEnumerable<SubtitleFormat> formats, string fileName, Subtitle sub, SubtitleFormat format, bool overwrite, int pacCodePage, double? targetFrameRate, IEnumerable<string> multipleReplaceImportFiles, bool removeTextForHi, bool fixCommonErrors, bool redoCasing)
{
double oldFrameRate = Configuration.Settings.General.CurrentFrameRate;
try
{
// adjust offset
if (!string.IsNullOrWhiteSpace(offset))
{
var offsetSplitChars = new[] { ':', '.', ',' };
var parts = offset.Split(offsetSplitChars, StringSplitOptions.RemoveEmptyEntries);
while (parts.Length > 1 && parts.Length < 4)
{
offset = "0:" + offset;
parts = offset.Split(offsetSplitChars, StringSplitOptions.RemoveEmptyEntries);
}
if (parts.Length == 4)
{
try
{
var ts = new TimeSpan(0, int.Parse(parts[0].TrimStart('-')), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]));
if (parts[0].StartsWith('-'))
sub.AddTimeToAllParagraphs(ts.Negate());
else
sub.AddTimeToAllParagraphs(ts);
parts = null;
}
catch
{
// ignored
}
}
if (parts != null)
{
Console.Write(" (unable to read offset " + offset + ")");
}
}
// adjust frame rate
if (targetFrameRate.HasValue)
{
sub.ChangeFrameRate(Configuration.Settings.General.CurrentFrameRate, targetFrameRate.Value);
Configuration.Settings.General.CurrentFrameRate = targetFrameRate.Value;
}
if (removeTextForHi)
{
var hiSettings = new Core.Forms.RemoveTextForHISettings();
var hiLib = new Core.Forms.RemoveTextForHI(hiSettings);
foreach (var p in sub.Paragraphs)
{
p.Text = hiLib.RemoveTextFromHearImpaired(p.Text);
}
}
if (fixCommonErrors)
{
using (var fce = new FixCommonErrors { BatchMode = true })
{
for (int i = 0; i < 3; i++)
{
fce.RunBatch(sub, format, targetEncoding, Configuration.Settings.Tools.BatchConvertLanguage);
sub = fce.FixedSubtitle;
}
}
}
if (redoCasing)
{
using (var changeCasing = new ChangeCasing())
{
changeCasing.FixCasing(sub, LanguageAutoDetect.AutoDetectGoogleLanguage(sub));
}
using (var changeCasingNames = new ChangeCasingNames())
{
changeCasingNames.Initialize(sub);
changeCasingNames.FixCasing();
}
}
if (multipleReplaceImportFiles != null && multipleReplaceImportFiles.Count() > 0)
{
using (var mr = new MultipleReplace())
{
mr.RunFromBatch(sub, multipleReplaceImportFiles);
sub = mr.FixedSubtitle;
sub.RemoveParagraphsByIndices(mr.DeleteIndices);
}
}
bool targetFormatFound = false;
string outputFileName;
foreach (SubtitleFormat sf in formats)
{
if (sf.IsTextBased && sf.Name.Replace(" ", string.Empty).Equals(targetFormat.Replace(" ", string.Empty), StringComparison.OrdinalIgnoreCase))
{
targetFormatFound = true;
sf.BatchMode = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, sf.Extension, outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
if (sf.IsFrameBased && !sub.WasLoadedWithFrameNumbers)
sub.CalculateFrameNumbersFromTimeCodesNoCheck(Configuration.Settings.General.CurrentFrameRate);
else if (sf.IsTimeBased && sub.WasLoadedWithFrameNumbers)
sub.CalculateTimeCodesFromFrameNumbers(Configuration.Settings.General.CurrentFrameRate);
//.........这里部分代码省略.........