ImageEn, unit imageenview

TImageEnView.LayersSelCount

TImageEnView.LayersSelCount


Declaration

function LayersSelCount(CountBackgroundLayer: Boolean = True): Integer;


Description

Return number of layers that are selected. If bCountBackgroundLayer is false, then the background layer (layer 0) is not included in the count.
If multiple layer selection is enabled then it counts any layer that has Selected set to true. Otherwise it just checks whether LayersCurrent is not -1.

A selected text layer:


Four selected layers:




Example

// Enable the "Remove Layers" button if a layer is selected (but not the background layer)
btnRemoveLayers.Enabled := ImageEnView1.LayersHaveSelection( False ) > 0;