ImageEn, unit imageenview

TImageEnView.LayersMergeAll

TImageEnView.LayersMergeAll


Declaration


procedure LayersMergeAll(AlphaCompositing: Boolean = False);


Description


Merge all layers into a single background image layer.
When AlphaCompositing is False then this method performs the same task as LayersDrawTo, but replaces all layers with the merged result.
This method is fast and works with all layer options, so should be used to merge layers before printing or saving. It does not support transparency.

When AlphaCompositing is True the result is equivalent to calling LayersMerge([]). LayersMergeFilter will specify the quality of image layers, if they do not have a custom UseResampleFilter


Examples


// Apply a "Paid" stamp to image
with ImageEnView1 do
begin
  LayersAdd( 'PAID', 42, clRed, 'Arial Black', [fsBold] );
  CurrentLayer.Rotate := 30;
  TIETextLayer( CurrentLayer ).SizeToText();
  CurrentLayer.PosX := IELayer_Pos_HCenter;
  CurrentLayer.PosY := IELayer_Pos_VCenter;
  LayersMergeAll();
end;

// Load an image, add text with a soft shadow and save it
var
  iev : TImageEnView;
begin
  iev := TImageEnView.Create( nil );
  iev.IEBitmap.LoadFromFile( 'd:\image.jpg' );
  iev.LayersAdd( ielkText, 100, 100 );
  TIETextLayer( iev.CurrentLayer ).Text := 'This is a test';
  TIETextLayer( iev.CurrentLayer ).Font.Size := 30;
  TIETextLayer( iev.CurrentLayer ).Font.Style := [fsBold];
  iev.CurrentLayer.SoftShadow.Enabled := True;
  iev.LayersMergeAll();
  iev.IEBitmap.SaveToFile( 'd:\image_out.jpg' );
  iev.Free;
end;


See Also


- LayersMerge
- LayersMergeFilter
- LayersMergeTo
- IELayersMerge
- LayersSaveMergedTo