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.
// Reduce the size of a JPEG image
aBmp := TIEBitmap.Create();
aBmp.ParamsEnabled := True; // Load params with the image
aBmp.LoadFromFile( 'C:\MyImage.jpeg' );
aBmp.Params.JPEG_Quality := 70;
aBmp.SaveToFile( 'C:\OutImage.jpeg' );
aBmp.Free;
// Which is the same as:
aBmp := TIEBitmap.Create();
aIOParams := TIOParams.Create();
aBmp.LoadFromFile( 'C:\MyImage.jpeg', aIOParams );
aIOParams.JPEG_Quality := 70;
aBmp.SaveToFile( 'C:\OutImage.jpeg', aIOParams );
aIOParams.Free();
aBmp.Free;
// Load the third image in a TIFF and save it to JPEG
aBmp := TIEBitmap.Create();
aBmp.ParamsEnabled := True; // Load params with the image
aBmp.Params.ImageIndex := 2;
aBmp.LoadFromFile( 'C:\MyTiffDoc.TIFF' );
aBmp.Params.JPEG_Quality := 70;
aBmp.SaveToFile( 'D:\Page3.jpeg' );
aBmp.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;