本文整理汇总了C#中Mode.CalcPixelBoundaries方法的典型用法代码示例。如果您正苦于以下问题:C# Mode.CalcPixelBoundaries方法的具体用法?C# Mode.CalcPixelBoundaries怎么用?C# Mode.CalcPixelBoundaries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mode
的用法示例。
在下文中一共展示了Mode.CalcPixelBoundaries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Refresh
public void Refresh(_BMDVideoOutputFlags flags)
{
WorkerThread.Singleton.PerformBlocking(() =>
{
foreach (var mode in FModes.Values)
Marshal.ReleaseComObject(mode.DisplayModeHandle);
FModes.Clear();
DeviceRegister.Singleton.Refresh();
foreach (var device in DeviceRegister.Singleton.Devices)
{
var output = (IDeckLinkOutput)device.DeviceHandle;
if (output == null)
throw (new Exception("Device has no outputs"));
IDeckLinkDisplayModeIterator modeIterator;
output.GetDisplayModeIterator(out modeIterator);
while (true)
{
IDeckLinkDisplayMode mode;
modeIterator.Next(out mode);
if (mode == null)
break;
foreach (_BMDPixelFormat pixelFormat in Enum.GetValues(typeof(_BMDPixelFormat)))
{
if (true || SupportedFormats.Contains(pixelFormat))
{
try
{
_BMDDisplayModeSupport support;
IDeckLinkDisplayMode displayMode;
output.DoesSupportVideoMode(mode.GetDisplayMode(), pixelFormat, flags, out support, out displayMode);
string modeString;
mode.GetName(out modeString);
int stripLength = "bmdFormat".Length;
string pixelFormatString = pixelFormat.ToString();
pixelFormatString = pixelFormatString.Substring(stripLength, pixelFormatString.Length - stripLength);
modeString += " [" + pixelFormatString + "]";
long duration, timescale;
mode.GetFrameRate(out duration, out timescale);
Mode inserter = new Mode()
{
DisplayModeHandle = mode,
Flags = flags,
PixelFormat = pixelFormat,
Width = mode.GetWidth(),
Height = mode.GetHeight(),
FrameRate = (double)timescale / (double)duration
};
inserter.CalcPixelBoundaries();
if (support == _BMDDisplayModeSupport.bmdDisplayModeSupported)
{
FModes.Add(modeString, inserter);
}
else if (support == _BMDDisplayModeSupport.bmdDisplayModeSupportedWithConversion)
{
modeString += " converted";
FModes.Add(modeString, inserter);
}
}
catch
{
}
}
}
}
}
});
}