ImageEn, unit iemio

TImageEnMIO.DuplicateCompressionInfo

TImageEnMIO.DuplicateCompressionInfo


Declaration


procedure DuplicateCompressionInfo();


Description


Clone the compression information of page 0 to all pages.


Examples


// Save monochrome TIFF
ImageEnMView1.MIO.Params[0].TIFF_Compression := ioTIFF_G4FAX;
ImageEnMView1.MIO.DuplicateCompressionInfo();
ImageEnMView1.MIO.SaveToFile('D:\output.tif');

// Save full-color TIFF
ImageEnMView1.MIO.Params[0].TIFF_Compression := ioTIFF_JPEG;
ImageEnMView1.MIO.DuplicateCompressionInfo();
ImageEnMView1.MIO.SaveToFile('D:\output.tif');

// Create a multi-frame DICOM image from a source file list
procedure TForm1.CreateMultiDicom(sl: TStrings; SaveFilename: string);
var
  mbmp: TIEMultiBitmap;
  mio: TImageEnMIO;
  bmp : TIEBitmap;
  i: Integer;
begin
  mbmp := TIEMultiBitmap.create;
  mio := TImageEnMIO.CreateFromIEMBitmap(mbmp);

  for i := 0 to sl.count-1 do
  begin
    bmp := TIEBitmap.Create();
    bmp.ParamsEnabled := True;
    bmp.Read(sl[i]);
    mbmp.AppendImage(bmp);
    bmp.Free;
  end;

  // Ensure all frames of DICOM are same size
  for I := 1 to mbmp.Count - 1 do
  begin
    bmp := mbmp.GetTIEBitmap( I );
    bmp.Resample( mbmp.ImageWidth[0], mbmp.ImageHeight[0], rfFastLinear );
    mbmp.ReleaseBitmap( I, True );
  end;

  // Ensure all frames of DICOM have same duplication and pixel format info
  mio.DuplicateCompressionInfo();

  mio.SaveToFileDICOM( SaveFilename );
  mio.Free;
  mbmp.free;
end;