发新话题
打印

[多媒体] VB视频调用问题

我用VB写的读取摄像头序号的程序,只能列出序号为“0”的摄像头来,不知道是为什么。
以下是摘自楼上的回复。
char szDeviceName[80];
char szDeviceVersion[80];
for (wIndex = 0; wIndex < 10; wIndex++)
{
    if (capGetDriverDescription (wIndex, szDeviceName,
        sizeof (szDeviceName), szDeviceVersion,
        sizeof (szDeviceVersion))
    {
        // 加入名字到一个已经安装的设备列表中
         // 让用户选择一个使用。
    }
}
以下代码是我用VB写的,语法跟上面不一样,但运行起来就只能列出序号为“0”的摄像头,不知道是什么原因
'---list all the various video sources---
Function ListVideoSources()
    Dim DriverName As String * 80
    Dim DriverVersion As String * 80
    Label1.Caption = ""
    For i = 0 To 9
        If capGetDriverDescriptionA(i, DriverName, 80, DriverVersion, 80) Then
            Label1.Caption = Label1.Caption & "第" & i & "个摄像头" & Trim(DriverName) & vbCrLf
        End If
    Next
End Function

TOP

发新话题