VB同时连接两个USB摄像头1Word格式.docx
- 文档编号:7382238
- 上传时间:2023-05-08
- 格式:DOCX
- 页数:22
- 大小:19.27KB
VB同时连接两个USB摄像头1Word格式.docx
《VB同时连接两个USB摄像头1Word格式.docx》由会员分享,可在线阅读,更多相关《VB同时连接两个USB摄像头1Word格式.docx(22页珍藏版)》请在冰点文库上搜索。
EndIf
capGetDriverDescriptionA1,lpszName1,100,lpszVer1,100'
lwndC1=capCreateCaptureWindowA(lpszName1,WS_VISIBLEOrWS_CHILD,0,0,Picture2.Width,Picture2.Height,Picture2.hWnd,0)
IfcapDriverConnect(lwndC1,0)Then
capDriverGetCapslwndC1,VarPtr(Caps1),Len(Caps1)
capPreviewScalelwndC1,True
capPreviewRatelwndC1,66
capPreviewlwndC1,True
SetWindowPoslwndC1,1,0,0,Picture2.Width,Picture2.Height,SWP_NOMOVEOrSWP_NOZORDER
模块1:
//------------------------------------------------------------------
//WindowsAPIConstants/Types/Declarations
PublicConstWM_USER=&
amp;
H400
TypePOINTAPI
xAsLong
yAsLong
EndType
DeclareFunctionSendMessageLib"
user32"
Alias"
SendMessageA"
(ByValhWndAsLong,ByValwMsgAsLong,ByValwParamAsInteger,ByVallParamAsLong)AsLong
DeclareFunctionSendMessageSLib"
(ByValhWndAsLong,ByValwMsgAsLong,ByValwParamAsInteger,ByVallParamAsString)AsLong
//WindowMessagesWM_CAP...whichcanbesenttoanAVICAPwindow
//Definesstartofthemessagerange
PublicConstWM_CAP_START=WM_USER
PublicConstWM_CAP_GET_CAPSTREAMPTR=WM_CAP_START+1
PublicConstWM_CAP_SET_CALLBACK_ERROR=WM_CAP_START+2
PublicConstWM_CAP_SET_CALLBACK_STATUS=WM_CAP_START+3
PublicConstWM_CAP_SET_CALLBACK_YIELD=WM_CAP_START+4
PublicConstWM_CAP_SET_CALLBACK_FRAME=WM_CAP_START+5
PublicConstWM_CAP_SET_CALLBACK_VIDEOSTREAM=WM_CAP_START+6
PublicConstWM_CAP_SET_CALLBACK_WAVESTREAM=WM_CAP_START+7
PublicConstWM_CAP_GET_USER_DATA=WM_CAP_START+8
PublicConstWM_CAP_SET_USER_DATA=WM_CAP_START+9
PublicConstWM_CAP_DRIVER_CONNECT=WM_CAP_START+10
PublicConstWM_CAP_DRIVER_DISCONNECT=WM_CAP_START+11
PublicConstWM_CAP_DRIVER_GET_NAME=WM_CAP_START+12
PublicConstWM_CAP_DRIVER_GET_VERSION=WM_CAP_START+13
PublicConstWM_CAP_DRIVER_GET_CAPS=WM_CAP_START+14
PublicConstWM_CAP_FILE_SET_CAPTURE_FILE=WM_CAP_START+20
PublicConstWM_CAP_FILE_GET_CAPTURE_FILE=WM_CAP_START+21
PublicConstWM_CAP_FILE_ALLOCATE=WM_CAP_START+22
PublicConstWM_CAP_FILE_SAVEAS=WM_CAP_START+23
PublicConstWM_CAP_FILE_SET_INFOCHUNK=WM_CAP_START+24
PublicConstWM_CAP_FILE_SAVEDIB=WM_CAP_START+25
PublicConstWM_CAP_EDIT_COPY=WM_CAP_START+30
PublicConstWM_CAP_SET_AUDIOFORMAT=WM_CAP_START+35
PublicConstWM_CAP_GET_AUDIOFORMAT=WM_CAP_START+36
PublicConstWM_CAP_DLG_VIDEOFORMAT=WM_CAP_START+41
PublicConstWM_CAP_DLG_VIDEOSOURCE=WM_CAP_START+42
PublicConstWM_CAP_DLG_VIDEODISPLAY=WM_CAP_START+43
PublicConstWM_CAP_GET_VIDEOFORMAT=WM_CAP_START+44
PublicConstWM_CAP_SET_VIDEOFORMAT=WM_CAP_START+45
PublicConstWM_CAP_DLG_VIDEOCOMPRESSION=WM_CAP_START+46
PublicConstWM_CAP_SET_PREVIEW=WM_CAP_START+50
PublicConstWM_CAP_SET_OVERLAY=WM_CAP_START+51
PublicConstWM_CAP_SET_PREVIEWRATE=WM_CAP_START+52
PublicConstWM_CAP_SET_SCALE=WM_CAP_START+53
PublicConstWM_CAP_GET_STATUS=WM_CAP_START+54
PublicConstWM_CAP_SET_SCROLL=WM_CAP_START+55
PublicConstWM_CAP_GRAB_FRAME=WM_CAP_START+60
PublicConstWM_CAP_GRAB_FRAME_NOSTOP=WM_CAP_START+61
PublicConstWM_CAP_SEQUENCE=WM_CAP_START+62
PublicConstWM_CAP_SEQUENCE_NOFILE=WM_CAP_START+63
PublicConstWM_CAP_SET_SEQUENCE_SETUP=WM_CAP_START+64
PublicConstWM_CAP_GET_SEQUENCE_SETUP=WM_CAP_START+65
PublicConstWM_CAP_SET_MCI_DEVICE=WM_CAP_START+66
PublicConstWM_CAP_GET_MCI_DEVICE=WM_CAP_START+67
PublicConstWM_CAP_STOP=WM_CAP_START+68
PublicConstWM_CAP_ABORT=WM_CAP_START+69
PublicConstWM_CAP_SINGLE_FRAME_OPEN=WM_CAP_START+70
PublicConstWM_CAP_SINGLE_FRAME_CLOSE=WM_CAP_START+71
PublicConstWM_CAP_SINGLE_FRAME=WM_CAP_START+72
PublicConstWM_CAP_PAL_OPEN=WM_CAP_START+80
PublicConstWM_CAP_PAL_SAVE=WM_CAP_START+81
PublicConstWM_CAP_PAL_PASTE=WM_CAP_START+82
PublicConstWM_CAP_PAL_AUTOCREATE=WM_CAP_START+83
PublicConstWM_CAP_PAL_MANUALCREATE=WM_CAP_START+84
//FollowingaddedpostVFW1.1
PublicConstWM_CAP_SET_CALLBACK_CAPCONTROL=WM_CAP_START+85
//Definesendofthemessagerange
PublicConstWM_CAP_END=WM_CAP_SET_CALLBACK_CAPCONTROL
//Structures
TypeCAPDRIVERCAPS
wDeviceIndexAsLong'
//Driverindexinsystem.ini
fHasOverlayAsLong'
//Candeviceoverlay?
fHasDlgVideoSourceAsLong'
//HasVideosourcedlg?
fHasDlgVideoFormatAsLong'
//HasFormatdlg?
fHasDlgVideoDisplayAsLong'
//HasExternaloutdlg?
fCaptureInitializedAsLong'
//Driverreadytocapture?
fDriverSuppliesPalettesAsLong'
//Candrivermakepalettes?
hVideoInAsLong'
//DriverInchannel
hVideoOutAsLong'
//DriverOutchannel
hVideoExtInAsLong'
//DriverExtInchannel
hVideoExtOutAsLong'
//DriverExtOutchannel
TypeCAPSTATUS
uiImageWidthAsLong'
//Widthoftheimage
uiImageHeightAsLong'
//Heightoftheimage
fLiveWindowAsLong'
//NowPreviewingvideo?
fOverlayWindowAsLong'
//NowOverlayingvideo?
fScaleAsLong'
//Scaleimagetoclient?
ptScrollAsPOINTAPI'
//Scrollposition
fUsingDefaultPaletteAsLong'
//Usingdefaultdriverpalette?
fAudioHardwareAsLong'
//Audiohardwarepresent?
fCapFileExistsAsLong'
//Doescapturefileexist?
dwCurrentVideoFrameAsLong'
//#ofvideoframescap'
td
dwCurrentVideoFramesDroppedAsLong'
//#ofvideoframesdropped
dwCurrentWaveSamplesAsLong'
//#ofwavesamplescap'
dwCurrentTimeElapsedMSAsLong'
//Elapsedcaptureduration
hPalCurrentAsLong'
//Currentpaletteinuse
fCapturingNowAsLong'
//Captureinprogress?
dwReturnAsLong'
//Errorvalueafteranyoperation
wNumVideoAllocatedAsLong'
//Actualnumberofvideobuffers
wNumAudioAllocatedAsLong'
//Actualnumberofaudiobuffers
TypeCAPTUREPARMS
dwRequestMicroSecPerFrameAsLong'
//Requestedcapturerate
fMakeUserHitOKToCaptureAsLong'
//Show"
HitOKtocap"
dlg?
wPercentDropForErrorAsLong'
//Giveerrormsgif&
gt;
(10%)
fYieldAsLong'
//Captureviabackgroundtask?
dwIndexSizeAsLong'
//Maxindexsizeinframes(32K)
wChunkGranularityAsLong'
//Junkchunkgranularity(2K)
fUsingDOSMemoryAsLong'
//UseDOSbuffers?
wNumVideoRequestedAsLong'
//#videobuffers,If0,autocalc
fCaptureAudioAsLong'
//Captureaudio?
wNumAudioRequestedAsLong'
//#audiobuffers,If0,autocalc
vKeyAbortAsLong'
//Virtualkeycausingabort
fAbortLeftMouseAsLong'
//Abortonleftmouse?
fAbortRightMouseAsLong'
//Abortonrightmouse?
fLimitEnabledAsLong'
//UsewTimeLimit?
wTimeLimitAsLong'
//Secondstocapture
fMCIControlAsLong'
//UseMCIvideosource?
fStepMCIDeviceAsLong'
//StepMCIdevice?
dwMCIStartTimeAsLong'
//TimetostartinMS
dwMCIStopTimeAsLong'
//TimetostopinMS
fStepCaptureAt2xAsLong'
//Performspatialaveraging2x
wStepCaptureAverageFramesAsLong'
//TemporalaveragenFrames
dwAudioBufferSizeAsLong'
//Sizeofaudiobufs(0=default)
fDisableWriteCacheAsLong'
//Attempttodisablewritecache
TypeCAPINFOCHUNK
fccInfoIDAsLong'
//ChunkID,"
ICOP"
forcopyright
lpDataAsLong'
//pointertodata
cbDataAsLong'
//sizeoflpData
TypeVIDEOHDR
//addressofvideobuffer
dwBufferLengthAsLong'
//size,inbytes,oftheDatabuffer
dwBytesUsedAsLong'
//seebelow
dwTimeCapturedAsLong'
dwUserAsLong'
//user-specificdata
dwFlagsAsLong'
dwReserved(3)AsLong'
//reserved;
donotuse}
//ThetwofunctionsexportedbyAVICap
DeclareFunctioncapCreateCaptureWindowALib"
avicap32.dll"
(_
ByVallpszWindowNameAsString,_
ByValdwStyleAsLong,_
ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,ByValnHeightAsInteger,_
ByValhWndParentAsLong,ByValnIDAsLong)AsLong
DeclareFunctioncapGetDriverDescriptionALib"
ByValwDriverAsInteger,_
ByVallpszNameAsString,_
ByValcbNameAsLong,_
ByVallpszVerAsString,_
ByValcbVerAsLong)AsBoolean
//StringIDsfromstatusanderrorcallbacks
PublicConstIDS_CAP_BEGIN=300'
/*"
CaptureStart"
*/
PublicConstIDS_CAP_END=301'
CaptureEnd"
PublicConstIDS_CAP_INFO=401'
%s"
PublicConstIDS_CAP_OUTOFMEM
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- VB 同时 连接 两个 USB 摄像头