请问一下,我下载的源码(vb.net)。为什么不能截图(黑屏)?
Public Function Click() As IntPtr
Dim hr As Integer ' get ready to wait for new image
m_PictureReady.Reset()
m_ipBuffer = Marshal.AllocCoTaskMem(Math.Abs(m_stride) * m_videoHeight)
Try
m_WantOne = True
' If we are using a still pin, ask for a picture
If m_VidControl IsNot Nothing Then ' Tell the camera to send an image
hr = m_VidControl.SetMode(m_pinStill, VideoControlFlags.Trigger) DsError.ThrowExceptionForHR(hr)
End If
' Start waiting
If Not m_PictureReady.WaitOne(9000, False) Then
Throw New Exception("Timeout waiting to get picture")
End If
Catch
Marshal.FreeCoTaskMem(m_ipBuffer)
m_ipBuffer = IntPtr.Zero
Throw
End Try
' Got one
Return m_ipBuffer
End Function
视频显示正常,但调用截图时黑屏
m_ip = cam.Click() Dim b As New Bitmap(cam.Width, cam.Height, 1920, PixelFormat.Format24bppRgb, m_ip)