ImageEn, unit iexBitmaps

TIOParams.AutoScaleImport

TIOParams.AutoScaleImport


Declaration

property AutoScaleImport: Boolean;


Description

Specifies whether PDF, WMF, EMF and ImageMagick files are imported at a reduced size.
If true, they will be loaded to the size specified by LoadToWidth and LoadToHeight.
If false, they are loaded at full size.

This is the same as specifying width and height parameters when using:
LoadFromFilePDF
ImportMetafile

Default: False


Examples

// Load WMF file as fast as possible, ensuring width is >= 150 and height >= 100 (while maintaining the aspect ratio)
ImageEnView1.IO.Params.LoadToWidth  := 150;
ImageEnView1.IO.Params.LoadToHeight := 100;
ImageEnView1.IO.Params.AutoScaleImport := True;
ImageEnView1.IO.LoadFromFile('C:\myimage.wmf');

// Which is the same as
ImageEnIO.ImportMetafile('C:\myimage.wmf', 150, 100);

// Load an SVG at size 2000x1000px
ImageEnView1.IO.Params.AutoScaleImport := True;
ImageEnView1.IO.Params.LoadToWidth     := 2000;
ImageEnView1.IO.Params.LoadToHeight    := 1000;
ImageEnView1.IO.LoadFromFile( 'D:\SVG\Lion.svg' );

// 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

OptimizeLoadingParams