ImageEn, unit iexProcEffects |
|
TIEImageEffectsList.SaveToFile
Declaration
procedure SaveToFile(const FileName: String);
Description
Save the list of
Image Processing effects (i.e. used to perform a set of operations upon an image).
Note: SaveToFile outputs in a custom ImageEn format. It can only be read using
LoadFromFile
// Save the current image effects chain to a file
if SaveDialog1.Execute() then
ImageEnView1.IEBitmap.EffectsChain.SaveToFile( SaveDialog1.FileName );
// Save an effects chain to file
var
opList: TIEImageEffectsList;
op: TIEImageEffect;
begin
opList := TIEImageEffectsList.Create();
op := TIEImageEffect.Create();
try
// Reduce size by half
op.Operation := peResize;
op.Resize_Width := 50;
op.Resize_Height := 50;
op.Resize_ByPercent := True;
op.Resize_QualityFilter := rfLanczos3;
opList.Add( op );
// Enhance contrast
op.Operation := peContrast;
op.Contrast_Contrast := 20;
opList.Add( op );
// Rotate 45 deg. clockwise
op.Operation := peRotate;
op.Rotate_Angle := -45;
op.Rotate_BackgroundColor := clBlack;
op.Rotate_Antialias := ierFast;
opList.Add( op );
opList.SaveToFile( 'D:\Effects.chain' );
finally
opList.Free;
op.Free;
end;
end;
// Apply effects in a chain file to current image
ImageEnView1.IEBitmap.EffectsChain.Enabled := True;
ImageEnView1.IEBitmap.EffectsChain.LoadFromFile( 'D:\Effects.chain' );
ImageEnView1.IEBitmap.EffectsChain.Apply();
See Also
◼SaveToStream
◼LoadFromFile
◼LoadFromStream