Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > Italian Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Download immagine senza salvarla

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2008, 12:29 PM
Junior Member
 
Join Date: Jul 2008
Posts: 38
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, 07:30 AM
Junior Member
 
Join Date: Jul 2008
Posts: 38
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, 10:24 AM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 977
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Ciao dibesw,

grazie per la routine , la userò nel mio Programmino http://www.basic4ppc.com/forum/germa...-charts-2.html

Ciao,
Filipppo
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with download file Byak@ Questions (Windows Mobile) 2 07-14-2008 06:14 PM
Why can't I Download all the examples? Jonathon Questions (Windows Mobile) 4 06-24-2008 04:18 PM
Download Files Raytracer Questions (Windows Mobile) 2 04-18-2008 12:57 PM
Download files Raytracer Italian Forum 4 04-13-2008 10:01 PM
Progress bar on FTP download willisgt Questions (Windows Mobile) 16 01-28-2008 04:22 PM


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


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0