本文整理汇总了C#中Converter.VideoInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Converter.VideoInfo方法的具体用法?C# Converter.VideoInfo怎么用?C# Converter.VideoInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter.VideoInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getVideoInfo
private void getVideoInfo()
{
Video video = new Video(fileName);
Converter = new Converter(video);
Converter.ProgressChanged += new ProgressChangedEventHandler(converter_ProgressChanged);
Converter.AllFinished += new AllFinishedEventHander(converter_AllFinished);
try
{
Converter.VideoInfo();
foreach (CheckBox resolutionCheckBox in resolutions)
{
int height = int.Parse((string)resolutionCheckBox.Tag);
resolutionCheckBox.IsEnabled = (video.Size.Height >= height || video.Size.Width >= (int)Math.Ceiling((double)height * 16 / 9));
if (resolutionCheckBox.IsEnabled)
{
Size newSize = video.NewSize(height);
BitRate newBitRate = video.ComputeNewBitRate(newSize);
double expectedSize = (((newBitRate.Video + newBitRate.Audio) * video.Duration.TotalSeconds) / 8000); // in MB
resolutionCheckBox.ToolTip = string.Format("{0}, {1} kb/s, ≈{2} MB", newSize.ToString("×"), newBitRate.Video, expectedSize.ToString("F"));
}
}
}
catch (ConverterException e)
{
height1080.IsEnabled = height720.IsEnabled = height480.IsEnabled = true;
height1080.ToolTip = height720.ToolTip = height480.ToolTip = null;
throw e;
}
}