ImageEn, unit imageenview

TImageEnView.LayersArrange

TImageEnView.LayersArrange


Declaration


procedure LayersArrange(CurIndex, NewIndex: Integer; SwapBackgroundProps: Boolean = False);


Description


Rearranges the layer at index, CurIndex, to the position, NewIndex.

You can specify LYR_SELECTED_LAYERS (-2) for CurIndex to move all selected layers.

NewIndex can be one of the following:
>= 0 The new insertion index
IEN_Send_To_Back The layer will become the new background layer (layer 0)
IEN_Send_Backward The layer will move closer to the background
IEN_Bring_Forward The layer will move closer to the foreground
IEN_Bring_To_Front The layer will become the topmost one (in front of all others)


If SwapBackgroundProps=True and the background layer (Layer 0) is being moved, the new background layer will inherit the Locked and Selectable properties of the old one (and vice versa).

Notes:
- If the layer has a mask it will be moved too
- Only a TIEImageLayer can be moved to layer 0 (i.e. background). If you attempt to move a non-image layer to position 0, it will be moved to 1
- Use LayersArrange to arrange layer order. Use LayersRepositionAll to change the position of layers


Example


// Move the current layer forward
ImageEnView1.LayersArrange( ImageEnView1.LayersCurrent, IEN_Bring_Forwards );

// Move selected layers backward
ImageEnView1.LayersArrange( LYR_SELECTED_LAYERS, IEN_Send_Backward );

// Move the selected layers to the back (but not replace the background layer
ImageEnView1.LayersArrange( LYR_SELECTED_LAYERS, 1 );


See Also


- LayerIndex