Hi,
I wrote this code basead in your code:
Delphi-Quellcode:
procedure TForm1.BitBtn2Click(Sender: TObject);
var
s: TStream;
uri:
String;
begin
uri:='
http://www.rotary.org/newsroom/downloadcenter/graphics/logos/programs/fellowships/fellowships_bmp.bmp';
s := TMemoryStream.Create;
with TIdHTTP.Create(
nil)
do
try
Get(
uri, s);
Image1.picture.bitmap.loadFromStream(s);
finally
Free;
s.Free;
end;
showMessage('
.');
end;
but dont work, dont appear image in the Image1 component...
I try to save the stream 's' to file and was generated a file with 0bytes...
so, Whats the problem if code above?
Zitat von
marabu:
Hi,
you can use the following code, which is a variation from over there:
klick
Delphi-Quellcode:
function DownloadBitmap(
uri:
String; bm: TBitmap): Boolean;
var
s: TStream;
begin
Result := False;
s := TMemoryStream.Create;
with TIdHTTP.Create(
nil)
do
try
Get(
uri, s);
bm.LoadFromStream(s);
Result := True;
finally
Free;
s.Free;
end;
end;
Kind Regards