Private Const WS_CHILD = H40000000
创新互联专注于企业成都营销网站建设、网站重做改版、习水网站定制设计、自适应品牌网站建设、H5建站、商城开发、集团公司官网建设、成都外贸网站建设公司、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为习水等各大城市提供网站开发制作服务。
Private Const WS_VISIBLE = H10000000
Private Const WM_CAP_START = H400
Private Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
Private Const WM_CAP_SET_SCALE = WM_CAP_START + 53
Private Const WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52
Private Const WM_CAP_SET_PREVIEW = WM_CAP_START + 50
Private Declare Function capCreateCaptureWindowA Lib "avicap32.dll" ( _
ByVal lpszWindowName As String, _
ByVal dwStyle As Long, _
ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Integer, _
ByVal hWndParent As Long, ByVal nID As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Private Sub Form_Load()
'建立采集窗口(不显示窗口,处理后显示到PIC控件)
uwndc = capCreateCaptureWindowA("", WS_VISIBLE Or WS_CHILD, 0, 0, 320, 240, Me.hWnd, 0)
'连接
SendMessage uwndc, WM_CAP_DRIVER_CONNECT, 0, 0
'Scale开
SendMessage uwndc, WM_CAP_SET_SCALE, True, 0
'显示刷新MS
SendMessage uwndc, WM_CAP_SET_PREVIEWRATE, 40, 0
'用予览方式显示(特殊需要,不显示予缆)
SendMessage uwndc, WM_CAP_SET_PREVIEW, True, 0
End Sub
上述代码就可以实现 但是要注意相应的控件是否存在 不存在的 你自己画出来
相机厂商有提供vb.net的SDK没有?没有的话需要自己从c++代码转化,无外乎就是通过回调函数返回一字节数组
1.点击打开开始菜单 - 电脑设置,打开电脑设置窗口。如下图所示2.在打开的电脑设置窗口中,点击打开“隐私”项进入下一步操作。如下图所示3.在隐私功能界面中,找到“摄像头”点击打开。如下图所示4.点击将允许应用使用我的摄像头开启,关闭电脑设置窗口完成操作
给你个工程自己看...
运行后可以看到自己...
点按钮保存到c:\1.bmp