Io ho questo codice che mi era stato postato però non so dove inserirlo.Cioè cosa va nel modulo.bas e cosa devo mettere in un
form( e soprattutto dove).Inoltre vorrei sapere che cosa
devo creare per l'interfaccia grafica.Grazie
1. Dichiarazioni funzioni su AVICAP.H
2. Window Messages da essere spediti alla finestra principale
3. definire le capacità del driver di cattura
4. definire lo stato corrente della capture window
4. una struttura che contiene i parametri che controllano il processo di cattura dello streaming video. E' usata per settare o interrogare i suddetti parametri
'* -----------------------------------------------------------
'* Dichiarazione funzioni API costanti e strutture aggiuntive
'* -----------------------------------------------------------
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
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
Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Public Const WS_CHILD = &H40000000
Public Const WS_VISIBLE = &H10000000
Public Const SWP_NOZORDER = &H4
Public Const SWP_NOMOVE = &H2
----------------------------------------------------
'* Creazione di una Capture Window
hWndCapture = capCreateCaptureWindow(WindowName, dwStyle, x, y, nWidth, nHeight, handWND, nID)
-------------------------------------------
****************************************
*******
'* Connessione della Capture Window al capture driver
fOK = capDriverConnect(hWndCapture)
If fOK Then
'* Resize della capture window
CapResizeWin (hWndCapture)
'* Richiesta delle capacità del capture driver
capDriverGetCaps hWndCapture, PubCapDrv
If PubCapDrv.fHasOverlay Then '* Se è possibile modo overlay...
fOK = capOverlay(hWndCapture, True) '* ...abilita l'overlay
Else
fOK = capPreviewRate(hWndCapture, 120) '* Altrimenti setta il PreviewRate
fOK = capPreview(hWndCapture, True) '* e lo abilita
End If
****************************************
************
5. routine per abilitare i pulsante dell'interfaccia grafica
7. Effettua il Resize della Capture Windows
'* Chiama il dialogo del driver di cattura VIDEODISPLAY
'* dal quale si può settare il contrasto la luminosita' e i colori
'* -----------------------------------------------------------------
Function capDlgVideoDisplay(hCapWnd As Long) As Boolean
capDlgVideoDisplay = IIf(SendMessage(hCapWnd, WM_CAP_DLG_VIDEODISPLAY, 0, 0), True, False)
End Function
'* Chiama il dialogo del driver di cattura VIDEOFORMAT
'* dal quale si può settare il formato video e la compressione harware
'* --------------------------------------------------------------------
Function capDlgVideoFormat(hCapWnd) As Boolean
capDlgVideoFormat = IIf(SendMessage(hCapWnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0), True, False)
End Function
'* Ritorna le capacità hardware del capture driver
'* attualmente connesso alla capture window
'* ------------------------------------------------
Function capDriverGetCaps(hCapWnd As Long, CapD As CAPDRIVERCAPS) As Boolean
capDriverGetCaps = IIf(SendMessage(hCapWnd, WM_CAP_DRIVER_GET_CAPS, Len(CapD), CapD), True, False)
End Function
'* Setta i parametri di configurazione
'* usati dallo streaming capture.
'* ------------------------------------
Function capCaptureSetSetup(hCapWnd As Long, CapP As CAPTUREPARMS)
capCaptureSetSetup = IIf(SendMessage(hCapWnd, WM_CAP_SET_SEQUENCE_SETUP, Len(CapP), CapP), True, False)
End Function
in un modulo .BAS devo mettere
Declare Function capCreateCaptureWindow Lib "avicap32" 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 hWnd As Long, ByVal nID As Long) As Long
Declare Function capGetDriverDescription Lib "avicap32" Alias "capGetDriverDescriptionA" (ByVal wDriverIndex As Integer, ByVal lpszName As String, cbName As Long, ByVal lpszVer As String, cbVer As Long) As Long