如何解决VB.net-Aforge视频捕获使用ClickOnce部署应用程序时,视频未显示在图片框上
我有这个应用程序,它可以从笔记本电脑中的集成摄像机捕获视频,当我在Visual Studio中运行它时,它可以正常工作,并且可以在pictureBox1
中看到视频流,但是当我部署该应用程序时(安装程序包或ClickOnce)并运行它,相机灯打开,但pictureBox1
中什么也不显示。而且没有错误消息。
请帮忙吗?
Public Sub callCam()
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
fiF = New FilterInfoCollection(FilterCategory.VideoInputDevice)
finalVideo = New VideoCaptureDevice(fiF(0).MonikerString)
finalVideo.VideoResolution = finalVideo.VideoCapabilities(0)
AddHandler finalVideo.NewFrame,New NewFrameEventHandler(AddressOf Scapture)
finalVideo.Start()
End Sub
Private Sub Scapture(ByVal sender As Object,ByVal eventArgs As NewFrameEventArgs)
If ButtonVIDEO.BackColor = Color.Black Then 'In case of Preview only (No recording)
Try
BMP = DirectCast(eventArgs.Frame.Clone(),Bitmap) 'Put the data in the bitmap
PictureBox1.Image = DirectCast(eventArgs.Frame.Clone(),Bitmap) 'present it in the Picture Box
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else ' In case of Recording
Try
BMP = DirectCast(eventArgs.Frame.Clone(),Bitmap) 'present it in the Picture Box
VFwriter.WriteVideoFrame(BMP) 'Save in Memory
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。