Autor Beitrag
jackie05
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: So 01.03.09 10:24 
Hallo,
ist es möglich in Image1 ein Bild zu laden über http:/www.....?
Also ohne das Bild erst runterladen zu müssen.

Ich bedanke mich schonmal für die Hilfe.

MfG


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am So 01.03.2009 um 23:45
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 01.03.09 10:30 
Nein. Ohne es herunterzuladen, ist das nicht möglich. Wie soll denn auch lokal etwas angezeigt werden, was nur auf einem Rechner irgendwo anders in der Welt zu finden ist?

_________________
We are, we were and will not be.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: So 01.03.09 10:33 
Auch, wenn die Formulierung das wohl kaum zulässt, glaube ich user profile iconjackie05 meint die Datei soll nicht erst in einem Ordner zwischengespeichert, sondern direkt in den Arbeitsspeicher geladen werden.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 01.03.09 10:37 
Naja, das wäre wohl schon möglich. Mit den Indy-Komponenten das Ding laden, aber nicht in eine Datei, sondern halt in einen Stream und dann das Bild darüber laden.

_________________
We are, we were and will not be.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: So 01.03.09 10:46 
Vielen Dank für die antworten.

@Gausi genaus so hatte ich das gemeint, wie könnte man das realisieren?

MfG
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 01.03.09 11:32 
Bei sowas muss ich auch etwas basteln, aber so geht es z.B. mit einem JPEG-Bild. Auf der Form sind ein TImage und eine TIdHttp-Komponente.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
uses Jpeg;

procedure TForm1.Button1Click(Sender: TObject);
var ms: TMemoryStream;
    jp: TJpegImage;
begin
    ms := TMemoryStream.Create;
    idhttp1.Get(MeineTolleBildURL, ms, []);
    ms.Position := 0;
    jp := TJpegIMage.Create;
    jp.LoadFromStream(ms);
    Image1.Picture.Bitmap.Assign(jp);
    jp.free;
    ms.free;
end;

_________________
We are, we were and will not be.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: So 01.03.09 11:57 
Vielen Dank für deine Mühe, es hat funktioniert.

MfG
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 01.03.09 12:12 
Du solltest aber noch Ressourcenschutzblöcke einbauen, damit die Objekte auch bei Exceptions freigegeben werden.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
uses Jpeg;

procedure TForm1.Button1Click(Sender: TObject);
var ms: TMemoryStream;
    jp: TJpegImage;
begin
    ms := TMemoryStream.Create;
    try
      idhttp1.Get(MeineTolleBildURL, ms, []);
      ms.Position := 0;
      jp := TJpegIMage.Create;
      try
        jp.LoadFromStream(ms);
        Image1.Picture.Bitmap.Assign(jp);
      finally
        jp.free;
      end;
    finally
      ms.free;
    end;
end;