Oder du übergibst der procedure Image1 als Parameter:
Delphi-Quellcode:
procedure GetBanner(AImage: TImage);
var
fAppPath: String;
begin
fAppPath := ExtractFilePath(Application.Exename);
UrlDownloadToFile(nil,
Pwidechar(
'http://myurl.com/banner.png'),
Pwidechar(fAppPath + 'banner.png'), 0, nil);
AImage.Picture.LoadFromFile(fAppPath + 'banner.png');
end;
procedure TForm6.FormCreate(Sender: TObject);
begin
GetBanner(Image1);
end;
Frank