求助:vb2012 directshow 摄像头拍照得到的照片一片黑
vb.net吧
全部回复
仅看楼主
level 1
yaqi00001 楼主
我用vb2012 directshow 编写的摄像头拍照程序,摄像头视频能够预览,但拍下的照片一片黑,代码如下:
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
Cursor.Current = Cursors.WaitCursor ' Release any previous buffer
If m_ip <> IntPtr.Zero Then
Marshal.FreeCoTaskMem(m_ip)
m_ip = IntPtr.Zero
End If 'capture image
m_ip = cam.Click()
Dim b As Bitmap
'Bitmap b = New Bitmap(cam.Width, cam.Height, cam.Stride, PixelFormat.Format24
bp
pRgb, m_ip)
b = New Bitmap(cam.Width, cam.Height, cam.Stride, PixelFormat.Format24bppRgb, m_ip)
' If the image is upsidedown
b.RotateFlip(RotateFlipType.RotateNoneFlipY)
PictureBox1.Image = b
If PictureBox1.Image IsNot Nothing Then
'pictureBox2
Cursor.Current = Cursors.Default
PictureBox1.Image.Save(Application.StartupPath + "/2.bmp")
End If
End Sub
2013年04月25日 01点04分 1
level 1
我也有这样的问题
2015年04月07日 08点04分 2
level 8
用emgucv或者forge.net
——来自 诺基亚 Lumia 925
2015年04月10日 11点04分 3
1