| ImageEn, unit imageenview |  | 
 
TImageEnView.LayersCropBackground
 
Declaration
procedure TImageEnView.LayersCropBackground(SelectedOnly: Boolean = False; FillAlpha: Integer = 255; AllowReduce: Boolean = True; AllowEnlarge : Boolean = True);
Description
Resize the background (layer 0) to fit all layers (the image is sized, but its content is not stretched).
 | Parameter | Description | 
 | SelectedOnly | The background will be cropped to fit selected layers only | 
 | FillAlpha | Alpha value used to fill added regions (0: Fully Transparent - 255: Opaque) | 
 | AllowReduce | Parts of the image can be cut so layers will align with image edges | 
 | AllowEnlarge | Parts will be added to the image so layers are not beyond hte image area | 
Note: The color of added background is specified by 
Background
// Crop the background so that it matches the size of all layers
ImageEnView1.LayersCropBackground();
// Crop the background so that it matches the size of selected layers
ImageEnView1.LayersCropBackground( True );
// Crop the background to match layers, but do not cut any part of the image (new border area may be added)
ImageEnView1.LayersCropBackground( True, 255, False, True );
// Crop the background to match layers, but do not add to the image (some layers may be outside the image area)
ImageEnView1.LayersCropBackground( True, 255, True, False );