ImageEn, unit iemview

TImageEnMView.OnFinishWork

TImageEnMView.OnFinishWork


Declaration

property OnFinishWork: TNotifyEvent;


Description

Occurs whenever an image processing or input/output task terminates.
It is always called after OnProgress and OnIOProgress so can be used to reset your progress bar.

You can check the class of the sender to determine the type of progress:
TImageEnIO: Loading of single frame images and thumbnails
TImageEnMIO: Loading of multi-frame images
TImageEnProc: Edit/effect processing of images
TImageEnMView: Filling content from a folder (when not loading on-demand)
TImageEnFolderMView: Reading image list when sub-folders are included


Example

// An example showing separate progress display for I/O operations and processing operations
procedure TMainForm.ImageEnMView1Progress(Sender: TObject; per: Integer);
begin
  // IMAGE PROCESSING PROGRESS
  if Sender is TImageEnProc then
  begin
    ProcProgressBar.Position := per;
    ProcProgressBar.Visible := True;
  end
  else
  // I/O PROGRESS
  begin
    IOProgressBar.Position := per;
    IOProgressBar.Visible := True;

    // Hide abort button
    btnAbort.Visible := False;
  end;
end;

// Hide the progress bar
procedure TMainForm.ImageEnMView1FinishWork(Sender: TObject);
begin
  // IMAGE PROCESSING PROGRESS
  if Sender is TImageEnProc then
    ProcProgressBar.Visible := False
  else
  // I/O PROGRESS
  begin
    IOProgressBar.Visible := False;

    // If filling content, allow user to abort
    if Sender is TImageEnMView then
      btnAbort.Visible := False;
  end;
end;