AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Bitmap.LoadFromFile (internetfile)
Thema durchsuchen
Ansicht
Themen-Optionen

Bitmap.LoadFromFile (internetfile)

Ein Thema von mr_fahrrad · begonnen am 9. Jan 2007 · letzter Beitrag vom 9. Jan 2007
 
mr_fahrrad

Registriert seit: 28. Dez 2006
46 Beiträge
 
#7

Re: Bitmap.LoadFromFile (internetfile)

  Alt 9. Jan 2007, 12:19
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
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:16 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz