ImageEn, unit imageenio

TImageEnIO.Aborting

TImageEnIO.Aborting


Declaration

property Aborting: Boolean;


Description

During an operation such as loading or saving, setting Aborting to true will halt the current process.

If set to True while loading, the loaded image will be truncated (i.e. only a portion of the image is loaded).
If set to True while saving, the file will be closed and truncated (i.e. it will be unreadable and should be deleted).

Aborting can also be read after loading or saving to determine if an error or abort occured.


Load Error Example

MyImageEnMView.LoadFromFileGIF('C:\MyGif.gif');
if MyImageEnMView.Aborting then
  ShowMessage('GIF Load Error!');

Which is the same as:
if MyImageEnMView.LoadFromFileGIF('C:\MyGif.gif') = False then
  ShowMessage('GIF Load Error!');


Abort Loading Example

// Begin to load image
procedure TForm1.btnLoadClick(Sender: TObject);
begin
  ImageEnView1.IO.LoadFromFile('C:\xyx.bmp');
end;

// Progress of load
procedure TForm1.ImageEnIO1Progress(Sender: TObject; per: Integer);
begin
  ProgressBar1.Position := per;
  Application.ProcessMessages();   // Important!
end;

// STOP! button
procedure TForm1.btnStopClick(Sender: TObject);
begin
  // Cancel loading
  ImageEnView1.IO.Aborting := True;
end;