ImageEn, unit iemview

TImageEnMView.OnProgress

TImageEnMView.OnProgress


Declaration

property OnProgress: TIEProgressEvent;


Description

Occurs during image processing or input/output operations. It is useful to display progress to the user of the current task.

You can check the class of the sender to determine the type of progress:
- 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 include

Notes:
- You can use OnFinishWork to reset the progress when the task has completed
- Progress for loading of single frame images and thumbnails (using a TImageEnIO) occurs with OnIOProgress


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;