Bei mit Flackert eine ProgressBar und ein TLabel, trotz
DoubleBuffered := true
! Habe ich da einen Fehler gemacht?
Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
i, j, Start, l : Integer;
k : Extended;
p: ^PixArray;
begin
Start := GetTickCount;
PBProgress.Max := Image.Height * Image.Width * 3;
PBProgress.Position := 0;
k := 255 / (TBColors.Position - 1);
for i := 0 to Image.Height - 1 do begin
p := Image.Picture.Bitmap.ScanLine[i];
for j := 0 to Image.Width do begin
for l := 1 to 3 do begin
p^[l] := Round(Round(p^[l] / k) * k);
PBProgress.Position := PBProgress.Position + 1;
PBProgress.Refresh;
end;
LTime.Caption := 'Working (' + IntToStr((GetTickCount - Start) div 1000) + ' s)';
LTime.Refresh;
inc(p);
end;
if CBRefresh.Checked then
Image.Repaint;
end;
LTime.Caption := 'Ready (' + FloatToStr((GetTickCount - Start) / 1000) + ' s)';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DoubleBuffered := true;
end;