最近用avicap32.dll调用摄像头,XP下正常,在win7及以上系统中,黑屏。试着捕获图片,有时可成功。我只要捕获图片,故可另辟蹊径,重写了一个类库,实现了启动摄像头、动态预览、实时抓图、获取分辨率和支持分辨率的功能,并简化了操作。要dll的留言,或5745519@qq.com
Dim l As Camera
Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Left = (Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2 '使窗口位于屏幕中间
Me.Top = (Screen.PrimaryScreen.WorkingArea.Height - Me.Height) / 3 '使窗口位于屏幕高度的1/3
l = New Camera(Me, Me.PictureBox3)
sccess = l.RunCam()
If sccess Then
Dim fbl As String() = l.GetResolution
For Each f As String In fbl
Me.CB_fbl.Items.Add(f)
Next
Me.CB_fbl.SelectedIndex = 0
Me.CB_fbl.Text = Getini("fbl", Me.CB_fbl.Text, mpath)
End If
End Sub
Private Sub Button_capture_Click(B