ImageEn, unit imageenview |
|
TImageEnView.LayersCreateFromSelection
TImageEnView.LayersCreateFromSelection
Declaration
function LayersCreateFromSelection(idx: Integer = -1): Integer;
Description
Creates a new
image layer from the current selection. This might be used to copy & paste selections, for example.
idx specifies the insertion index for the layer, or -1 to append.
Returns the index of the new layer.
// select an ellipse
ImageEnView1.SelectEllipse(150, 150, 50, 50);
// copy selected area and create a new layer
ImageEnView1.LayersCreateFromSelection;
// move the new layer
ImageEnView1.CurrentLayer.PosX := 100;
ImageEnView1.CurrentLayer.PosY := 100;
// paste to the background
ImageEnView1.LayersMerge(0, 1);