Altin
Altin

Reputation: 2245

How do I get the list of all the cameras?

I have this code right now:

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

But it gets just one camera. Can anyone help me?

Upvotes: 1

Views: 1557

Answers (1)

George
George

Reputation: 2213

Looks like Touchless.Cameras is a list of cameras and by doing Cameras.ElementAt(0) you are explicitly selecting the first from the list.

try this:

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

Then you can use cameras(0) to access the first camera, cameras(1) the second, and so on.

Or you can just loop Cameras like this:

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

Upvotes: 1

Related Questions