1 / 16
文档名称:

vb摄像头.doc

格式:doc   页数:16页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

vb摄像头.doc

上传人:endfrs 2015/10/20 文件大小:0 KB

下载得到文件列表

vb摄像头.doc

相关文档

文档介绍

文档介绍:程序:
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOMOVE = &H2
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Dim VHandle As Long
Private Function CreateCapture(hwnd As Long)
VHandle = capCreateCaptureWindow("VIDEO", WS_CHILD Or WS_VISIBLE, 0, 0, 640, 480, , 0)
For i = 1 To 50
SendMessageAsLong VHandle, WM_CAP_DRIVER_CONNECT, 0, 0
Next i
SendMessageAsLong VHandle, WM_CAP_SET_PREVIEWRATE, 60, 0
SendMessageAsLong VHandle, WM_CAP_SET_OVERLAY, 1, 0
SendMessageAsLong VHandle, WM_CAP_SET_PREVIEW, 1, 0
Dim cs As CAPSTATUS
capGetStatus VHandle, cs
SetWindowPos hwnd, 0, 0, 0, , , SWP_NOSIZE Or SWP_NOMOVE
End Function
Private Function CapClose()
capDriverDisconnect VHandle
End Function
Private Function CopytoPicture(ByRef pic As PictureBox)
capGrabFrameNoStop (VHandle)
capEditCopy (VHandle)
If (capFileSaveDIB(VHandle, "d:\") = False) Then
MsgBox "error"
End If
pic = ()
End Function
Private Sub Form_Load()
CreateCapture ()
End Sub
Private mand1_Click()
'capDlgVideoFormat VHandle
CopytoPicture Picture2
End Sub
Private Sub Form_Unload(Cancel As Integer)
CapClose
End Sub
模块文件:
Attribute VB_Name = "mVFW"
'****************************************************************
'* VB file: ... VB32 wrapper for Win32 Video For Windows
'* functions.
'* created: 1998 by Ray Mercer
'* modified: 12/02/98 by Ray Mercer (ments)
'* last modified: 01/04/99 by Ray Mercer (changed capGetVideoFormat()
'* and capSetVideoFormat() macro wrappers to make them
'* easier to use)
'*
'* A Visual Basic translation of Microsoft's file which is
'* part of the Win32 Platform SDK (VFW DDK)
'*
'* Download the latest version of this file at
'*
'* Copyright