Autor Beitrag
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 23.02.03 15:43 
Hallo,
wie kann ich eine % anzeige im folgende code einbauen ?
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.BitBtn3Click(Sender: TObject);
var
  x,y,i:Integer;
begin
  Image2.Picture:=Image1.Picture;
  for y:=0 to Image2.Height do begin
    for x:=0 to Image2.Width do begin
      for i:=0 to ListView1.Items.count -1 do begin
        Application.ProcessMessages;
        if ac = 1 then Exit; 
        if StringToColor( ListView1.Items[i].Caption ) = Image2.Canvas.Pixels[x,y] then
          Image2.Canvas.Pixels[x,y]:=StringToColor(ListView1.Items[i].SubItems.strings[0] );
      end;
    end;
  end;

end;

ich möchte eine einfach % anzeige erzeugen, aber wie ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: So 23.02.03 15:54 
Zitat:

procedure TForm1.BitBtn3Click(Sender: TObject);
var
x,y,i:Integer;
ProgressBar:TProgressBar;
All,Done:integer;

begin
All:=Image2.Height*Image2.Width*(ListView1.Items.Count-1);
Done:=0;
ProgressBar:=TProgressBar.Create(Form1);
ProgressBar.Parent:=Form1;
ProgressBar.Left:=50;
ProgressBar.Top:=50;

Image2.Picture:=Image1.Picture;
for y:=0 to Image2.Height do begin
for x:=0 to Image2.Width do begin
for i:=0 to ListView1.Items.count -1 do begin
Application.ProcessMessages;
Done:=y*x*i;
ProgressBar.Position:=round(Done/All*100);

if ac = 1 then Exit;
if StringToColor( ListView1.Items[i].Caption ) = Image2.Canvas.Pixels[x,y] then
Image2.Canvas.Pixels[x,y]:=StringToColor(ListView1.Items[i].SubItems.strings[0] );
end;
end;
end;
ProgressBar.free;

end;


Sollte funktionieren! Der Code ist nicht getestet!

maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 23.02.03 16:12 
OK! Danke werde ich gleich mal testen !

_________________
MFG
Michael Springwald, "kann kein englisch...."
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 23.02.03 16:23 
Er sprint immer von 3 auf 1 zurück und das stänidg !
weißt du woran das liegen könnte ?
StepMax ist auf 1 gestelt
und den rest habe ich so gelssaen ;)

_________________
MFG
Michael Springwald, "kann kein englisch...."
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: So 23.02.03 16:38 
Ersetze mal Done:=y*x*i; durch inc(Done); :!:

maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 23.02.03 17:00 
Die % anzeige ist schneller bei 100 als das bild fertig ist, warum ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: So 23.02.03 17:22 
Ich weiß es nicht!

Mach mal ausAll:=Image2.Height*Image2.Width*(ListView1.Items.Count-1); All:=Image2.Height*Image2.Width*ListView1.Items.Count; :!:

Ist aber nur ne Vermutung...

maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 23.02.03 18:30 
!!!! ES FUNKTIONIERT !!!

DANKE !!!!!!!

_________________
MFG
Michael Springwald, "kann kein englisch...."
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mo 24.02.03 16:55 
8) Gern geschehen! 8)

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mo 24.02.03 19:40 
Sage mal, wüsstes du das auch bei einer längern procedure ?
die ist zu lang daüfür das ich sie hier inst Forum posten kann.
Wenn du mir na mail an mimi_171@gmx.de sendes kann ich dir die proceudre senden ;)
könntes du dann da auch sowas wie eine % anezeige rein machen ?

_________________
MFG
Michael Springwald, "kann kein englisch...."