// Change the compression method for a TIFF file MBitmap := TIEMultiBitmap.Create(); MBitmap.ParamsEnabled := True; MBitmap.LoadFromFile( 'C:\MyImage.tiff' ); MBitmap.Params[ 0 ].TIFF_Compression := ioTIFF_G4FAX; MBitmap.DuplicateCompressionInfo(); MBitmap.SaveToFile( 'C:\OutImage.tiff' ); MBitmap.Free;
// Create a multi-frame DICOM image from a source file list procedure TForm1.CreateMultiDicom(sl: TStrings; SaveFilename: string); var mbmp: TIEMultiBitmap; bmp : TIEBitmap; i: Integer; begin mbmp := TIEMultiBitmap.Create();
for i := 0 to sl.count-1 do begin bmp := TIEBitmap.Create(); bmp.ParamsEnabled := True; bmp.LoadFromFile(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 mbmp.DuplicateCompressionInfo();
// Save all pages to PDF (A4) with centered images (and no scaling of small images) ImageEnMView1.MIO.Params[0].PDF_PaperSize := iepA4; ImageEnMView1.MIO.Params[0].PDF_PageMargin := Round( 0.25 * 72 ); // 1/4 inch ImageEnMView1.MIO.Params[0].PDF_ImageOptions := [iepioShrinkOnly, iepioCentered]; ImageEnMView1.MIO.DuplicateCompressionInfo(TRUE); ImageEnMView1.MIO.SaveToFilePDF('d:\test.pdf');