![]() MessageRequester( " error ", " capture device not found! " ) / Enumerate device hr = #Null, * pCDE) If FAILED( hr) MessageRequester( " error ", " enum sys devices failed! " ) EndIf * * pEM, 0 ) If * pEM = 0 MessageRequester( "Įrror ", " enum video devices failed! " ) / Connect filtering and capture * pCapture\SetFiltergraph( * pGraph) / Query and bind interface * * pMC) * * pME) * * MessageRequester ( " ERRO ", " the init dx Capture failed The! " ) ![]() Hr = CoCreateInstance _ CLSID_CaptureGraphBuilder2, #NULL, # CLSCTX_INPROC, IID_ICaptureGraphBuilder2, * pCapture) / Get interface hr = #Null, * pGraph) If FAILED(hr) MessageRequester( " error * pWc = AllocateMemory( 1024 ) used to convert unicode Pokes ( * PWideChar, String, Len ( string ), #PB_Unicode) #CLSCTX_SERVER = #CLSCTX_INPROC_SERVER | #CLSCTX_LOCAL_SERVER | #CLSCTX_REMOTE_SERVER #CLSCTX_INPROC_SERVER #CLSCTX_INPROC_HANDLER #S_OK = 0 #OATRUE = - 1 #OAFALSE = 0 #CLSCTX_INPROC_SERVER = $ 01 #CLSCTX_INPROC_HANDLER = $ 02 #CLSCTX_LOCAL_SERVER = $ 04 #CLSCTX_REMOTE_SERVER = $ 10 #CLSCTX_ALL = #CLSCTX_INPROC_SERVER | #CLSCTX_INPROC_HANDLER | #CLSCTX_LOCAL_SERVER | #CLSCTX_REMOTE_SERVER #CLSCTX_INPROC = | The header file is mainly to plagiarize the constant definition inside, and it has no other use.ĭirect××× is based on com, vc can be used, purebasic of course can also be, and more concise The lib file is no longer needed, it has already been integrated, and it is enough to do such a small thing Purebasic can be understood as c+, note that there is less +, after all, object-oriented is not supported, so the header file can also be used as raw material If you use directshow, it is more troublesome, but it is more efficient, and you need to use a camera with wdm driverīefore you start, you must first get a lot of directshow header files (the sample code has already written all the necessary parts, not enough to transfer by yourself), it is not easy to find, because now directshow has been moved from directx to windows. SendMessage_(hWndC, #WM_CAP_STOP, 0, 0 SendMessage_(hWndC, #WM_CAP_DRIVER_DISCONNECT, 0 ) ![]() SendMessage_ (hWndC, #WM_CAP_SET_PREVIEWRATE, 30, 0 ) SendMessage_ (hWndC, #WM_CAP_SET_PREVIEW, #True, 0 ) SendMessage_ (hWndC, #WM_CAP_DRIVER_CONNECT, 0, 0 ) HWndC = CallFunctionFast( * capAddress, " My Capture Window ", #WS_CHILD | #WS_VISIBLE, 10, 10, 640, 480, WindowID ( 0 ). * capAddress = GetFunction( 0, " capCreateCaptureWindowA " ) If OpenLibrary( 0, " C:\WINDOWS\system32\avicap32.dll " ) , 0, 0, 660, 500, " Video capture " ,#PB_Window_ScreenCentered | #PB_Window_SystemMenu) 11 #WM_CAP_DRIVER_GET_CAPS = #WM_CAP_START + 14 #WM_CAP_SET_PREVIEW = #WM_CAP_START + 50 #WM_CAP_SET_PREVIEWRATE = #WM_CAP_START + 52 is #WM_CAP_STOP = #WM_CAP_START + 68 Debug #CLSID_SystemDeviceEnum If OpenWindow( 0 #WM_CAP_DRIVER_CONNECT = #WM_CAP_START + 10 #WM_CAP_DRIVER_DISCONNECT = #WM_CAP_START +.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |