将值返回为WebCameraId

时间:2017-06-13 09:04:26

标签: vb.net

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?

1 个答案:

答案 0 :(得分: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

它将Camera的值返回到CamId。我现在可以使用SQL数据库中的StartCapture。