Bild ausm internet speichern
Hi, möchte ein programm schreibn, dem man eine url eintippt (zb http://irgendwas.de/bild.jpg) und der das bild dann an einem bestimmten ort abspeichert. Kann mir jemand sagn wie ich das mit dem abspeichern anstellen kann? also der soll das automatisch abspeichern, ohne dialoge
MFG NightFox |
Re: Bild ausm internet speichern
Mit den Indys zB
Du nimmst ein IdHTTP und rufst IdHTTP.Get() auf, speicherst das resultat in einem Filestream. |
Re: Bild ausm internet speichern
ok danke für die schnelle antwort, wie geht das mit dem abspeichern? Bin noch neu auf dem gebiet ^^
Danke |
Re: Bild ausm internet speichern
sehr einfach:
Delphi-Quellcode:
oder so ähnlich!
procedure TForm1.Button1Click(Sender: TObject);
var fs: TFileStream; begin fs := TFileStream.Create('C:\Test.jpg', fmCreate); try IdHTTP1.Get('http://irgendwas.de/bild.jpg', fs); finally fs.Free; end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:11 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz