我如何获得所有相机的列表?

时间:2012-12-14 17:18:45

标签: vb.net camera

我现在有这个代码:

Public Touchless As New TouchlessLib.TouchlessMgr
Public Camera1 As TouchlessLib.Camera = Touchless.Cameras.ElementAt(0)

但它只有一台相机。任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

看起来Touchless.Cameras是一个摄像头列表,而Cameras.ElementAt(0)你明确地从列表中选择了第一个。

试试这个:

Public cameras() As TouchlessLib.Camera = Touchless.Cameras

然后您可以使用cameras(0)访问第一个摄像头,cameras(1)访问第二个摄像头,依此类推。

或者你可以像这样循环相机:

For Each cam As TouchlessLib.Camera In Touchless.Cameras
    ' do what you want with cam
next