ImageEn, unit imageenview |
|
TImageEnView.LayersCurrent
Declaration
property LayersCurrent: Integer;
Description
Returns or sets the active layer (the index of the layer returned by
CurrentLayer).
The first layer has the index of 0, the last is
LayersCount - 1.
Making a layer current changes the
IEBitmap, so it points to the current layer (allowing specification of which layer is active for input/output and image processing operations).
Note:
◼Use
CurrentLayer to return the layer object. Use
LayersCurrent to get or set the current layer by its index
◼Setting LayersCurrent does NOT deselect existing layers (if
multiple layer selection is enabled)
// load 'first.jpg' in layer 0 and 'second.jpg' in layer 1
ImageEnView1.LayersCurrent := 0;
ImageEnView1.IO.LoadFromFile('C:\first.jpg');
ImageEnView1.LayersCurrent := 1;
ImageEnView1.IO.LoadFromFile('C:\second.jpg');
// Clear the top-most layer
ImageEnView1.LayersCurrent := ImageEnView1.LayersCount - 1;
ImageEnView1.Clear;
// Flip the 2nd layer
ImageEnView1.LayersCurrent := 1;
ImageEnView1.Proc.Flip( fdHorizontal );
// Make the 3rd layer the active selected layer
ImageEnView1.LayersDeselectAll();
ImageEnView1.LayersCurrent := 3;