- Private Sub Form_Load()
- Dim intBoucle As Integer
- Dim fso As FileSystemObject
- Dim f As file
- Dim tsmFile As TextStream
- '---------------------RECUPERATION DU FICHIER PARAMETRE-------------------------
- 'on recupere le chemin ou l'on sauvegardera l'image temporaire et la finale
- Set fso = New FileSystemObject
- Set f = fso.GetFile(C_INI)
- Set tsmFile = f.OpenAsTextStream
- strChemin = tsmFile.ReadLine
- tsmFile.Close
- Set tsmFile = Nothing
- Set f = Nothing
- Set fso = Nothing
- '-------------------------------------------------------------------------------
-
- 'on met une qualite JPG par defaut
- sldQual.Value = 50
- sldQual_Click
- cmdRun.Caption = "Stop Camera"
- CamRunning = True
- 'on lance la creation de la capture
- mCapHwnd = capCreateCaptureWindow("My Own Capture Window", 0, 0, 0, 320, 240, Me.hwnd, 0)
- 'on dit a la capture qu'on se connect a la cam
- SendMessage mCapHwnd, WM_CAP_DRIVER_CONNECT, 0, 0
-
- 'on mets un frequence par defaut
- sldFrequence.Value = C_DFTFREQUENCE
- sldFrequence_Click
- DoEvents
- End Sub
-
- Private Sub sldFrequence_Click()
- Const C_DEBRAF As String = "Raffraichissement toutes les "
- Const C_FINRAF As String = " s"
- 'on divise par 1000 pour l'affichage en secondes
- lblSave.Caption = C_DEBRAF & CStr(sldFrequence.Value / 1000) & C_FINRAF
- 'on adapte le timer en fonction du choix fait sur la slidebar
- Timer1.Interval = CInt(sldFrequence.Value)
- DoEvents
- End Sub
Private Sub Form_Load()
Dim intBoucle As Integer
Dim fso As FileSystemObject
Dim f As file
Dim tsmFile As TextStream
'---------------------RECUPERATION DU FICHIER PARAMETRE-------------------------
'on recupere le chemin ou l'on sauvegardera l'image temporaire et la finale
Set fso = New FileSystemObject
Set f = fso.GetFile(C_INI)
Set tsmFile = f.OpenAsTextStream
strChemin = tsmFile.ReadLine
tsmFile.Close
Set tsmFile = Nothing
Set f = Nothing
Set fso = Nothing
'-------------------------------------------------------------------------------
'on met une qualite JPG par defaut
sldQual.Value = 50
sldQual_Click
cmdRun.Caption = "Stop Camera"
CamRunning = True
'on lance la creation de la capture
mCapHwnd = capCreateCaptureWindow("My Own Capture Window", 0, 0, 0, 320, 240, Me.hwnd, 0)
'on dit a la capture qu'on se connect a la cam
SendMessage mCapHwnd, WM_CAP_DRIVER_CONNECT, 0, 0
'on mets un frequence par defaut
sldFrequence.Value = C_DFTFREQUENCE
sldFrequence_Click
DoEvents
End Sub
Private Sub sldFrequence_Click()
Const C_DEBRAF As String = "Raffraichissement toutes les "
Const C_FINRAF As String = " s"
'on divise par 1000 pour l'affichage en secondes
lblSave.Caption = C_DEBRAF & CStr(sldFrequence.Value / 1000) & C_FINRAF
'on adapte le timer en fonction du choix fait sur la slidebar
Timer1.Interval = CInt(sldFrequence.Value)
DoEvents
End Sub