【发布时间】:2016-05-11 00:33:14
【问题描述】:
我正在使用 AForge.Video 在我的笔记本电脑中使用摄像头。 但是为什么摄像头拍摄的视频没有居中呢?
下面是我的代码:
Dim videoDevices As FilterInfoCollection
Dim videoSource As VideoCaptureDevice
videoDevices = New FilterInfoCollection(FilterCategory.VideoInputDevice)
videoSource = New VideoCaptureDevice(videoDevices(0).MonikerString)
AddHandler videoSource.NewFrame, AddressOf Me.video_NewFrame
Sub video_NewFrame(sender As Object,
eventArgs As NewFrameEventArgs)
Dim bitmap As Bitmap
Try
bitmap = eventArgs.Frame
If Not bitmap Is Nothing Then
PictureBox1.Image = DirectCast(bitmap.Clone(), Bitmap)
PictureBox1.Refresh()
End If
Catch
End Try
End Sub
谢谢!
【问题讨论】: