Autor Beitrag
sascha2005
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

WinXP
D7
BeitragVerfasst: Mi 28.06.06 20:31 
hab hier mal nach mein problem gesucht aber nix gefunden.
meine frage ist:
kann man ein bild das man aus dem internet läd auch stückweise anzeigen lassen
ist dies mit JvThumbImage1Progress möglich oder gibt es dafür ein anderes image das sich besser dafür eignet.
ich muss dazu sagen das ich noch ein kleiner anfänger bin was delphi betrifft...
sascha2005 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

WinXP
D7
BeitragVerfasst: Sa 01.07.06 18:19 
Problem gelöst.
Danke Sebastian :D

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
procedure TBildLadenThread.Execute;
var
  i: Integer;
  Source: TFileStream;
  Destination: TMemoryStream;
  CurrentPosition: Integer;
begin
  if FileExists(AppPathWithDelim + 'Dummy' + ExtractFileExt(BildX)) then
    MainExplorer.JvImage1.Picture.LoadFromFile(AppPathWithDelim + 'Dummy' + ExtractFileExt(BildX))
  else
    Exit;
    MainExplorer.Bildladen1.Tag := 1;
    MainExplorer.Bildladen1.Enabled := False;

    MainExplorer.ProgressBar1.Visible := True;

    Destination := TMemoryStream.Create;
    Source := TFileStream.Create(BildX, fmOpenRead or fmShareDenyNone);

    for i := 1 to Source.Size div 32768 do
    begin
      Destination.CopyFrom(Source, 32768);
      MainExplorer.ProgressBar1.Position := 100 * Source.Position div Source.Size;
      CurrentPosition := Destination.Position;
      Destination.Position := 0;
      MainExplorer.JvImage1.Picture.Graphic.LoadFromStream(Destination);
      Destination.Position := CurrentPosition;
    end;
    if Source.Position <> Source.Size then
      Destination.CopyFrom(Source, Source.Size - Source.Position);
    Source.Free;

    MainExplorer.ProgressBar1.Visible := False;
    Destination.Position := 0;
    MainExplorer.JvImage1.Picture.Graphic.LoadFromStream(Destination);

    Destination.Free;
end;