this slowpoke moves

Download Picture and load to Image

uses URLMon, Jpeg

function DownloadFile(const url: string; filename: string): boolean;
begin
  Result := urlmon.URLDownloadToFile(nil, PChar(url), PChar(filename), 0, nil) = 0;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
  if DownloadFile('https://duet-cdn.vox-cdn.com/thumbor/0x0:2012x1341/640x427/filters:focal(1006x670:1007x671):format(webp)/cdn.vox-cdn.com/uploads/chorus_asset/file/15483559/google2.0.0.1441125613.jpg', 'c:\picture')
  then image1.Picture.LoadFromFile('C:\picture.jpg')
  else
  showmessage('Sorry, geht irgendwie nicht!');
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate