本文整理匯總了C#中Nikse.SubtitleEdit.Core.Subtitle.ChangeFrameRate方法的典型用法代碼示例。如果您正苦於以下問題:C# Subtitle.ChangeFrameRate方法的具體用法?C# Subtitle.ChangeFrameRate怎麽用?C# Subtitle.ChangeFrameRate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Nikse.SubtitleEdit.Core.Subtitle
的用法示例。
在下文中一共展示了Subtitle.ChangeFrameRate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestChangeFrameRate2
public void TestChangeFrameRate2()
{
var sub = new Subtitle();
var p1 = new Paragraph("1", 0, 1000);
var p2 = new Paragraph("2", 2000, 3000);
sub.Paragraphs.Add(p1);
sub.Paragraphs.Add(p2);
sub.ChangeFrameRate(25.0, 30.0);
Assert.AreEqual(sub.Paragraphs.Count, 2);
Assert.AreEqual(sub.Paragraphs[0].StartTime.TotalMilliseconds, 0);
Assert.IsTrue(Math.Abs(sub.Paragraphs[0].EndTime.TotalMilliseconds - 833.33333333333) < 0.01);
Assert.IsTrue(Math.Abs(sub.Paragraphs[1].StartTime.TotalMilliseconds - 1666.6666666666667) < 0.01);
Assert.IsTrue(Math.Abs(sub.Paragraphs[1].EndTime.TotalMilliseconds - 2500) < 0.01);
}
示例2: TestChangeFrameRate1
public void TestChangeFrameRate1()
{
var sub = new Subtitle();
var p1 = new Paragraph("1", 0, 1000);
var p2 = new Paragraph("2", 2000, 3000);
sub.Paragraphs.Add(p1);
sub.Paragraphs.Add(p2);
sub.ChangeFrameRate(25.0, 25.0);
Assert.AreEqual(sub.Paragraphs.Count, 2);
Assert.AreEqual(sub.Paragraphs[0].StartTime.TotalMilliseconds, 0);
Assert.AreEqual(sub.Paragraphs[0].EndTime.TotalMilliseconds, 1000);
Assert.AreEqual(sub.Paragraphs[1].StartTime.TotalMilliseconds, 2000);
Assert.AreEqual(sub.Paragraphs[1].EndTime.TotalMilliseconds, 3000);
}