Habe da ein Problem wo ich nicht weiterkomme. Den Quellcode habe ich von hier :http://www.purearea.net/pb/CodeArchiv/I ... teImage.pb
Nach Modifikation sieht er jetzt so aus.
Code: Alles auswählen
; German forum: http://www.purebasic.fr/german/archive/viewtopic.php?t=2015&highlight=
; Author: Danilo (updated for PB4.00 by blbltheworm)
; Date: 18. August 2003
; OS: Windows
; Demo: No
; #page defines the address of the image to load
; #page definiert die Adresse des zu ladenden Bildes
;---------------- Orginal hier -----------------------------
Procedure UpdateImage()
#page = "http://gast:gast@192.168.1.81:81/snapshot.cgi" ; there is probably only every xx minutes a new picture on the server !
DeleteUrlCacheEntry_(#page)
URLDownloadToFile_(0,#page, "c:\__temp.jpg", 0, 0)
LoadImage(0, "c:\__temp.jpg")
DeleteFile("c:\__temp.jpg")
Ergebnis = ResizeImage(0, 320, 240)
If IsGadget(0)
SetGadgetState(0,ImageID(0))
EndIf
EndProcedure
;-----------------------------
Procedure UpdateImage1(x$,id)
;#page1 = "http://gast:gast@192.168.1.82:81/snapshot.cgi" ; there is probably only every xx minutes a new picture on the server !
DeleteUrlCacheEntry_(x$)
URLDownloadToFile_(0,x$, "c:\__temp.jpg", 0, 0)
x=LoadImage(id, "c:\__temp.jpg")
DeleteFile("c:\__temp.jpg")
; If x <>0
Ergebnis = ResizeImage(id, 320, 240)
If IsGadget(id)
SetGadgetState(id,ImageID(id))
EndIf
; EndIf
EndProcedure
UseJPEGImageDecoder()
UpdateImage()
OpenWindow(0, 0, 0, 650, 500, "PB - Webcam!", #PB_Window_SystemMenu)
ImageGadget(0,0,0,320,240,ImageID(0),#PB_Image_Border)
ImageGadget(1,321,0,320,240,ImageID(0),#PB_Image_Border)
AddWindowTimer(0, 123,500)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Timer
webcam$="http://gast:gast@sundisp.zapto.org:81/snapshot.cgi"
UpdateImage1(webcam$,0)
webcam$="http://www.alfa2.it/current.jpg"
UpdateImage1(webcam$,1)
EndSelect
ForEver
; IDE Options = PureBasic v4.00 (Windows - x86)
; Folding = -
; EnableXP
warum es mal geht mal nicht ?
Heute Vormittag habe ich hier meine beiden Webcams zum laufen gebracht. Nachmittag gleiche Einstellung neu gestartet und nur noch Standbild. Mit externe Webadressen geht es Anscheind nur warum ?
(meine eigenen Cams http://gast:gast@192.168.1.82:81/snapshot.cgi : und
http://gast:gast@192.168.1.81:81/snapshot.cgi)
mfg. Herb