ImageEn, unit imageenview

TImageEnView.OnFinishWork

TImageEnView.OnFinishWork


Declaration

property OnFinishWork: TNotifyEvent;


Description

Occurs whenever an image processing or input/output task terminates.
It is always called after OnProgress so is useful to reset a progress bar.

Note: To determine the type of completed task, check the class of the Sender, e.g.
TImageEnIO: I/O task, e.g. loading/saving images
TImageEnProc: Image processing task, e.g. rotating the image
TImageEnView (Uncommon): Layer processing task, e.g. merging all layers

Example code:

  if Sender is TImageEnView then
    ShowMessage( 'Layer Task has finished' )
  else
  if Sender is TImageEnIO then
    ShowMessage( 'IO Task has finished' )
  else
  if Sender is TImageEnProc then
    ShowMessage( 'Processing Task has finished' );



Example

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

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


See Also

OnImageLoaded
OnBeforeLoadImage
OnIONotify