Autor Beitrag
bawa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 49



BeitragVerfasst: Di 02.01.07 18:01 
Hi,
ich hab eine Prozedur die läd ein bild aus dem internet in ein Timage -- Funktioniert alles perfekt jetzt habe ich nur ein problem :
ich will in einer Progressbar anzeigen lassen wie weit der download ist:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm3.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
  const AWorkCount: Integer);
begin
ProgressBar1.Position := AWorkCount;
end;

procedure TForm3.IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
  const AWorkCountMax: Integer);
begin
ProgressBar1.Max := AWorkCountMax;
end;


leider passiert nichts beim downbload hier meine download prozedur:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure tform3.Download();
var
begin
 IdHTTP1 := TIdHTTP.Create(self);
URL := 'www.Adresse.xy/'+daten.Strings[1] ;
 try
  //Zur Sicherheit
  imagestream.Seek(0,sofrombeginning);
  //Download
  idHTTP1.Get(URL, imagestream);
   Finally
IdHTTP1.Free;
end;
 imagestream.Seek(0,sofrombeginning);
end;
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 02.01.07 18:04 
Probier mal Application.ProcessMessages ins OnWork.

Ich hab jetz innerhalb von 2 Tagen 3 Threads mit Application.ProcessMessages beantwortet :lol:

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
bawa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 49



BeitragVerfasst: Di 02.01.07 18:08 
hat nicht geholfen :(
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 02.01.07 18:11 
Kanns vielleicht sein, dass der Download so schnell vorbei ist, dass OnWork überhaupt nicht aufgerufen wird?
Weil eigentlich muss das mit dem Allpication.ProcessMessages im OnWork funktionieren.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
bawa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 49



BeitragVerfasst: Di 02.01.07 18:17 
nein bei der datei mit der ich es teste ist die spanne zwischen workbegin und workend ca 6 sek (2mb) was bewirkt den Application.ProcessMessages überhaupt?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 02.01.07 18:20 
Du sagt über das ProgressBar1.Progress:=... das: Bei nächster gelegenheit bitte den Stand ... der ProgressBar auf den Bildschirm malen. Und mit Application.ProcessMessages gibste ihm halt diese Gelegenheit.

PS: Probiers mal mit ProgressBar1.Update, das zeichnet einfach die ProgressBar neu.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
bawa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 49



BeitragVerfasst: Di 02.01.07 18:29 
Funktioniert auch nicht aber ich glaube ich hab den fehler : Mein programm ruft OnWork garnich auf :( obwohl er 10 sek brauch um sie zu laden