2017-06-13 9 views
0
Try 
    For Each Camera As WebCameraId In frmMain.wcc.GetVideoCaptureDevices 

     If cbCamera.SelectedItem = Camera.GetHashCode Then 
      txtCamName.Text = Camera.Name 
     End If 
    Next 

Catch ex As Exception 
    MsgBox(ex.Message) 
End Try 

どのように値をwebcameraIdに返すことができますか?戻り値WebCameraIdとして戻る

+0

返す変数は? [ツアー]をして[尋ねる] – Mederic

答えて

0

このコマンドは、問題

Try 
     Dim CamId As New List(Of WebCameraId)(frmMain.wcc.GetVideoCaptureDevices()) 
     For Each Camera As WebCameraId In frmMain.wcc.GetVideoCaptureDevices 

      If cbCamera.SelectedItem = Camera.GetHashCode Then 
       txtCamName.Text = Camera.Name 
       txtCamIndex.Text = CamId.IndexOf(Camera) 
       frmMain.wcc.StartCapture(CamId(txtCamIndex.Text)) 
      End If 
     Next 

    Catch ex As Exception 
     MsgBox("Error 0x03102090Cam" & ex.Message) 
    End Try 

それがCAMIDにカメラの値を返すを解決しました。 SQLデータベースからStartCaptureを使用できるようになりました。