![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Ciao a tutti, da qualche parte ho letto (ma non ne sono sicuro) che esiste la possibilità di eseguire il download di una immagine senza necessariamente salvarla per poi metterla su un comtrollo image. Esiste questa possibilità? Grazie.
|
|
|||
|
OK! ho scoperto come si fa.
la routine seguente esegue senza errori il download del file e lo salva in un LocalFile: (ad es. URL=http://www.amalfiweb.it/webcam/img/webcam_00045.jpg) Sub DownloadFile (LocalFile,URL) ErrorLabel (errurl) Response.New1 Request.New1(URL) Response.Value = Request.GetResponse Reader.New1(Response.GetStream,true) FileOpen(c3,LocalFile,cRandom) Writer.New1(c3,false) Dim buffer(4096) As byte count = Reader.ReadBytes(buffer(),4096) Do While count > 0 Writer.WriteBytes2(buffer(),0,count) count = Reader.ReadBytes(buffer(),4096) Loop FileClose(c3) Response.Close Return errurl: msgbox("Errore su load","Load immagine") End Sub Il problema è che se rieseguo la routine, per fare ad es. un refresh, il sistema mi da errore perchè il file (cioè l'immagine) risulta lockkata. la routine seguente risolve questo caso perchè non esegue il salvataggio dell'immagine Sub cercacam(URL) ErrorLabel (errurl) Request.New1(URL) Response.New1 obj.New1(false) args.New1(1) Response.Value = Request.GetResponse args.SetObject(0,Response.GetStream) ' obj.CreateNew2("System.Drawing.Bitmap" & obj.System_Drawing,args.Value) image1.Image = obj.Value response.Close erore=0 Return errurl: erore=1 End Sub le librerie sono HTTP e DOOR. Spero sia stato utile a qualcuno. Ciao |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help with download file | Byak@ | Questions & Help Needed | 2 | 07-14-2008 07:14 PM |
| Why can't I Download all the examples? | Jonathon | Questions & Help Needed | 4 | 06-24-2008 05:18 PM |
| Download Files | Raytracer | Questions & Help Needed | 2 | 04-18-2008 01:57 PM |
| Download files | Raytracer | Italian Forum | 4 | 04-13-2008 11:01 PM |
| Progress bar on FTP download | willisgt | Questions & Help Needed | 16 | 01-28-2008 05:22 PM |