ImageEn, unit iexBitmaps

TIEBitmap.ParamsEnabled

TIEBitmap.ParamsEnabled

Declaration

property ParamsEnabled: Boolean;

Description

If ParamsEnabled is True, then this object stores the Input/Output parameters (meta-data) for the image, which can be accessed via Params.

Default: False

Note:
ParamsEnabled will be automatically set to True if Params is accessed
ParamsEnabled should only be used when TIEBitmap is being used as a stand-alone object. When it is attached to a TImageEnView or TImageEnMIO, use TImageEnIO.Params instead.

Examples

// Reduce the size of a JPEG image
bmp := TIEBitmap.Create();
bmp.ParamsEnabled := True;     // Load params with the image
bmp.LoadFromFile( 'C:\MyImage.jpeg' );
bmp.Params.JPEG_Quality := 70;
bmp.SaveToFile( 'C:\OutImage.jpeg' );
bmp.Free();

// Which is the same as:
bmp := TIEBitmap.Create();
ioParams := TIOParams.Create();
bmp.LoadFromFile( 'C:\MyImage.jpeg', ioParams );
ioParams.JPEG_Quality := 70;
bmp.SaveToFile( 'C:\OutImage.jpeg', ioParams );
ioParams.Free();
bmp.Free();


// Load the third image in a TIFF and save it to JPEG
bmp := TIEBitmap.Create();
bmp.ParamsEnabled := True; // Load params with the image
bmp.Params.ImageIndex := 2;
bmp.LoadFromFile( 'C:\MyTiffDoc.TIFF' );
bmp.Params.JPEG_Quality := 70;
bmp.SaveToFile( 'D:\Page3.jpeg' );
bmp.Free();


// Convert an SVG file to JPEG at max size of 1000x1000 (will be adjusted to maintain aspect ratio)
var
  bmp: TIEBitmap;
begin
  bmp := TIEBitmap.Create();
  try
    bmp.ParamsEnabled := True;
    bmp.Params.LoadToWidth  := 1000;
    bmp.Params.LoadToHeight := 1000;
    bmp.Params.AutoScaleImport := True;
    bmp.LoadFromFile('D:\Input.svg');
    bmp.Params.JPEG_Quality := 90;
    bmp.SaveToFile('D:\Output.jpg');
  finally
    bmp.Free();
  end;
end;

See Also

TIEBitmap.Params
TImageEnIO.Params