Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Bild ausm internet speichern (https://www.delphipraxis.net/94015-bild-ausm-internet-speichern.html)

NightFox 14. Jun 2007 19:33


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

inherited 14. Jun 2007 19:38

Re: Bild ausm internet speichern
 
Mit den Indys zB
Du nimmst ein IdHTTP und rufst IdHTTP.Get() auf, speicherst das resultat in einem Filestream.

NightFox 14. Jun 2007 19:41

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

luka 14. Jun 2007 20:56

Re: Bild ausm internet speichern
 
sehr einfach:
Delphi-Quellcode:
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;
oder so ähnlich!


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