本文整理汇总了C#中AForge.Video.DirectShow.FilterInfoCollection.Cast方法的典型用法代码示例。如果您正苦于以下问题:C# FilterInfoCollection.Cast方法的具体用法?C# FilterInfoCollection.Cast怎么用?C# FilterInfoCollection.Cast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AForge.Video.DirectShow.FilterInfoCollection
的用法示例。
在下文中一共展示了FilterInfoCollection.Cast方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Webcam
private Webcam()
{
_videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
_currentDevice = _videoDevices.Cast<FilterInfo>().First();
_videoSource = new VideoCaptureDevice(_currentDevice.MonikerString);
_videoSource.NewFrame += _videoSource_NewFrame;
_takePicture = false;
}
示例2: Stream
private void Stream()
{
var devices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
var list = devices.Cast<FilterInfo>().ToArray();
cmbDeviceList.DisplayMember = "Name";
cmbDeviceList.ValueMember = "MonikerString";
cmbDeviceList.Items.AddRange(list);
if (devices.Count > 0)
{
SetCaptureDevice(devices[0].MonikerString);
cmbDeviceList.SelectedIndex = 0;
}
if (devices.Count == 0)
{
cmbDeviceList.Text = "No Devices Found";
}
if (devices.Count > 1)
{
cmbDeviceList.Enabled = false;
}
}
示例3: InitializeWebCamList
//-----------------public methods
/// <summary>
/// Charge la liste des WebCams connectés à l'ordinateur
/// </summary>
public void InitializeWebCamList()
{
SelectedDevice = null;
Devices = null;
_videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
if (_videoDevices.Count == 0)
return;
Devices = _videoDevices.Cast<FilterInfo>().ToList();
SelectedDevice = Devices[0];
}