Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Foreign Languages > Italian Forum
Home Register FAQ Members List Search Today's Posts Mark Forums Read


Download immagine senza salvarla


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2008, 01:29 PM
Newbie
 
Join Date: Jul 2008
Posts: 8
Default Download immagine senza salvarla

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.
Reply With Quote
  #2 (permalink)  
Old 08-23-2008, 08:30 AM
Newbie
 
Join Date: Jul 2008
Posts: 8
Default

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
Reply With Quote
  #3 (permalink)  
Old 11-10-2008, 11:24 AM
Filippo's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 260
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Ciao dibesw,

grazie per la routine , la userò nel mio Programmino Aktien-Charts

Ciao,
Filipppo
__________________
PPC: MDA Pro, 2GB SD
PPC: HTC Touch Diamond, 4GB
______________________
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 11:49 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0