hello friend...
i have same trouble with my code...
i want to save image form 4 IP camera and save image to drive C:
for this case i am use webview.
this is my code :
application fine if not save/record image so drive C: bud when i record image, aplication run very slowly...may be save 2 second/image.
i have same trouble with my code...
i want to save image form 4 IP camera and save image to drive C:
for this case i am use webview.
this is my code :
B4X:
Sub timeout_Tick ' if tick timer1 on (open kamera 1)
timer1.Enabled=True
timeout.Enabled=False
End Sub
Sub timer1_Tick
webview1.LoadUrl("http://192.168.0.11/CH1.jpg?") ' open page IP camera 1
timer1.Enabled=False 'timer1 off
End Sub
Sub WebView1_PageFinished (URL As String)
label1.Text="1"
If counter1 >0 Then: counter1 =counter1 -1
Else :counter1=10000 ' get 10.000 frame image
End If
save (1,counter1 )
webview2.LoadUrl("http://192.168.0.12/CH2.jpg?")' open page IP camera 2
timeout.Enabled=True ' timer timeout is on
End Sub
Sub WebView2_PageFinished (URL As String)
label1.Text="2"
If counter2 >0 Then: counter2=counter2 -1
Else :counter2=10000
End If
save (2,counter2 )
webview3.LoadUrl("http://192.168.0.13/CH3.jpg?")' open page IP camera 3
timeout.Enabled=True' timer timeout is on
End Sub
Sub WebView3_PageFinished (URL As String)
label1.Text="3"
If counter3 >0 Then: counter3 =counter3 -1
Else :counter3=10000
End If
save (3,counter3 )
webview4.LoadUrl("http://192.168.0.14/CH4.jpg?")' open page IP camera 4
timeout.Enabled=True' timer timeout is on
End Sub
Sub WebView4_PageFinished (URL As String)
label1.Text="4"
If counter3 >0 Then: counter3 =counter3 -1
Else :counter1=10000
End If
save (4,counter4 )
webview1.LoadUrl("http://192.168.0.11/CH1.jpg?")' open page IP camera 1
timeout.Enabled=True' timer timeout is on
End Sub
Sub save (number_kamera As Int,number_image As String)
If flag_record=True Then
Select number_kamera:
Case 1 : Dim out As OutputStream = File.OpenOutput("C:\KAMERA 1", number_image&".png", False):webview1.Snapshot.WriteToStream(out)
Case 2 : Dim out As OutputStream = File.OpenOutput("C:\KAMERA 2", number_image&".png", False):webview2.Snapshot.WriteToStream(out)
Case 3 : Dim out As OutputStream = File.OpenOutput("C:\KAMERA 3", number_image&".png", False):webview3.Snapshot.WriteToStream(out)
Case 4 : Dim out As OutputStream = File.OpenOutput("C:\KAMERA 4", number_image&".png", False):webview4.Snapshot.WriteToStream(out)
End Select
out.Close
End If
End Sub
application fine if not save/record image so drive C: bud when i record image, aplication run very slowly...may be save 2 second/image.
Last edited: