給你個工程自己看...
創(chuàng)新互聯(lián)主營巴彥淖爾網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,重慶APP開發(fā)公司,巴彥淖爾h5小程序制作搭建,巴彥淖爾網(wǎng)站營銷推廣歡迎巴彥淖爾等地區(qū)企業(yè)咨詢
運行后可以看到自己...
點按鈕保存到c:\1.bmp
1.點擊打開開始菜單 - 電腦設(shè)置,打開電腦設(shè)置窗口。如下圖所示
2.在打開的電腦設(shè)置窗口中,點擊打開“隱私”項進(jìn)入下一步操作。如下圖所示
3.在隱私功能界面中,找到“攝像頭”點擊打開。如下圖所示
4.點擊將允許應(yīng)用使用我的攝像頭開啟,關(guān)閉電腦設(shè)置窗口完成操作。如下圖所示
Private Const WS_CHILD = H40000000
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
上述代碼就可以實現(xiàn) 但是要注意相應(yīng)的控件是否存在 不存在的 你自己畫出來
網(wǎng)站名稱:vb.net攝像頭視頻的簡單介紹
標(biāo)題路徑:http://jinyejixie.com/article34/ddcodse.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供虛擬主機(jī)、移動網(wǎng)站建設(shè)、企業(yè)建站、營銷型網(wǎng)站建設(shè)、電子商務(wù)、建站公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)