lally361
lally361
2015-08-14 09:37

VB.NET调用摄像头拍照只能拍一次,再拍就会出现捕获源,选择视频设备,点确定后没有用

50
  • 摄像头
  • net

VB.NET调用摄像头拍照只能拍一次,再拍就会出现捕获源,选择视频设备,点确定后没有用,依然是黑屏,但是将笔记本重启后再打开就可以拍一次,然后又不行,还要重启后才能拍。
这个代码只能在2008里打开,如果谁能给编一个2010的调用摄像头拍照的更好,不要糊弄,csdn里的我们都下载尝试了,没一个好的,谢谢,以下是代码,感觉需要在stop那里做文章,求大神帮忙,重赏。

 Public Class Form1
Dim cccap As ClsCamera
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    cccap = New ClsCamera(picView.Handle, 0, 0, picView.Width, picView.Height)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnStart.Click
    cccap.Start()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnStop.Click
    cccap.Stop()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCapture.Click
    cccap.GrabImage("c:\test.bmp")
End Sub

Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
    cccap = Nothing
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnColor.Click
    cccap.capDlgVideoSource()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSize.Click
    cccap.capDlgVideoFormat()
End Sub
End Class

图片说明

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

5条回答

为你推荐

换一换