真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb.net外接攝像頭 vb調(diào)用攝像頭實現(xiàn)拍照

VB.NET 攝像頭編程求助大神們幫幫忙

下面是我之前在VB6里測試過的代碼:在窗體里放一個按鈕叫Command1和一個PictureBox叫Picture1。 Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" _ Alias "capCreateCaptureWindowA" ( _ ByVal lpszWindowName As String, _ ByVal dwStyle As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal hWndParent As Long, _ ByVal nID As Long) As Long Private Const WS_CHILD = H40000000 Private Const WS_VISIBLE = H10000000 Private Const WM_USER = H400 Private Const WM_CAP_START = H400 Private Const WM_CAP_EDIT_COPY = (WM_CAP_START + 30) Private Const WM_CAP_DRIVER_CONNECT = (WM_CAP_START + 10) Private Const WM_CAP_SET_PREVIEWRATE = (WM_CAP_START + 52) Private Const WM_CAP_SET_OVERLAY = (WM_CAP_START + 51) Private Const WM_CAP_SET_PREVIEW = (WM_CAP_START + 50) Private Const WM_CAP_DRIVER_DISCONNECT = (WM_CAP_START + 11) Private Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" ( _ ByVal hWnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Any) As Long Private Declare Function SendMessageAsLong Lib "user32" Alias "SendMessageA" _ (ByVal hWnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long Private Preview_Handle As Long Private iDevice As Long Private hHwnd As Long Private Sub Command1_Click() Dim bRet As Boolean Dim szTest As String szTest = App.Path "\TEST.bmp" Chr$(0) bRet = capEditCopy(hHwnd) If bRet Then DoEvents If Clipboard.GetFormat(vbCFBitmap) Then Picture1.Picture = Clipboard.GetData(vbCFBitmap) Picture1.Picture = Clipboard.GetData(vbCFBitmap) SavePicture Picture1.Image, szTest DoEvents Clipboard.Clear End If End If End Sub Private Sub Form_Load() '建立捕獲窗口 Preview_Handle = capCreateCaptureWindow("Video", WS_CHILD + WS_VISIBLE, 0, 0, 320, 240, Me.hWnd, 1) '建立捕獲窗口到捕獲設(shè)備的連接 SendMessage Preview_Handle, WM_CAP_DRIVER_CONNECT, 0, 0 '設(shè)置捕獲的幀頻率為30毫秒一幀 SendMessage Preview_Handle, WM_CAP_SET_PREVIEWRATE, 30, 0 '用預(yù)覽模式在捕獲窗口開始預(yù)覽圖像 SendMessage Preview_Handle, WM_CAP_SET_PREVIEW, 1, 0 End Sub Private Sub Form_Unload(Cancel As Integer) '斷開到捕獲設(shè)備的連接 SendMessage Preview_Handle, WM_CAP_DRIVER_DISCONNECT, 0, 0 End Sub Private Function capEditCopy(ByVal hCapWnd As Long) As Boolean capEditCopy = SendMessageAsLong(hCapWnd, WM_CAP_EDIT_COPY, 0, 0) End Function

成都創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于網(wǎng)站制作、成都網(wǎng)站設(shè)計、華坪網(wǎng)絡(luò)推廣、重慶小程序開發(fā)公司、華坪網(wǎng)絡(luò)營銷、華坪企業(yè)策劃、華坪品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;成都創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供華坪建站搭建服務(wù),24小時服務(wù)熱線:18980820575,官方網(wǎng)址:www.cdcxhl.com

windows8.1下VB.net使用攝像頭

這個方法沒問題。

win8.1,我用網(wǎng)上的方法,有時也有黑屏現(xiàn)象,但多試幾次就好了。有時還會彈出要選擇攝像頭,選擇確認、取消、應(yīng)用都是黑屏。

VB.NET怎么調(diào)用攝像頭啊?求實例,最好配注釋啊

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)的控件是否存在 不存在的 你自己畫出來


分享標題:vb.net外接攝像頭 vb調(diào)用攝像頭實現(xiàn)拍照
URL分享:http://weahome.cn/article/hhidsd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部