TIECustomMultiBitmap.OnProgress
Declaration
property OnProgress: TIEProgressEvent;
Description
Occurs when image processing or input/output operations are executed.
Note: The Sender parameter may be this bitmap or a
TImageEnMIO object, depending on the operation.
// Code to load an image, rotate all frames by 90 deg. and then save with continuous progress display
private
fCurrentStep: Integer;
fStepCount: Integer;
...
procedure TForm1.BmpShowProgress(Sender: TObject; per: Integer);
begin
ProgressBar1.Position := Trunc( fCurrentStep * 100 / fStepCount + ( per / fStepCount ));
ProgressBar1.Visible := True;
end;
procedure TForm1.BmpHideProgress();
begin
ProgressBar1.Visible := False;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
mbmp: TIEMultiBitmap;
begin
fStepCount := 3; // Three progress events will occur
mbmp := TIEMultiBitmap.Create();
try
mbmp.OnProgress := BmpShowProgress;
fCurrentStep := 0;
mbmp.LoadFromFile('D:\Image.tiff');
fCurrentStep := 1;
mbmp.RotateAll(90);
fCurrentStep := 2;
mbmp.SaveToFile('D:\Image_Done.tiff');
finally
mbmp.Free();
BmpHideProgress();
end;
end;