ImageEn, unit imageenio

TImageEnIO.AttachedIEBitmap

TImageEnIO.AttachedIEBitmap


Declaration

property AttachedIEBitmap: TIEBitmap


Description

Contains the attached TIEBitmap object (same value as the IEBitmap property).


Example

// Print all frames of a multi-page TIFF (TIEBitmap)
procedure PrintAllPages(const Filename: string);
Var
  bmp: TIEBitmap;
  io: TImageEnIO;
  i: Integer;
Begin
  bmp := TIEBitmap.Create();
  io  := TImageEnIO.Create(nil);
  io.AttachedIEBitmap := bmp;
  try
    io.LoadFromFile( Filename  );

    Printer.Title := 'TIFF Pages';
    Printer.BeginDoc();
    for i := 0 to io.Params.ImageCount - 1 do
    begin
      io.Params.ImageIndex := i;
      if i > 0 then
        io.LoadFromFile( Filename );
      io.PrintImage();
    end;
    Printer.EndDoc();

  finally
    io.Free;
    bmp.Free;
  end;
End;

// Multi-threaded saving
Var
  bmp: TIEBitmap;
  io: TImageEnIO;
Begin
  bmp := TIEBitmap.Create;
  io  := TImageEnIO.Create(nil);
  io.AttachedIEBitmap := bmp;
  try
    io.LoadFromFile('C:\input.bmp');
    io.AsyncMode := True;  // So it will create a thread for each input/output task
    io.SaveToFile('D:\i1.jpg');  // thread 1
    io.SaveToFile('D:\i2.jpg');  // thread 2
    io.SaveToFile('D:\i3.jpg');  // thread 3
  finally
    io.Free;  // Free method will wait for all tasks to end!
    bmp.Free;
  end;
End;