Specifies a name for the layer. If name is specified it is displayed in the Layer viewer
You can also search for layers by name using LayersNameToIndex.
Note: ImageEn does not check that the specified name is unique. I.e. it is permitted to use the same name on multiple layers
procedure TfrmMain.ievMainLayerNotifyEx(Sender: TObject; layer: Integer; event: TIELayerEvent); begin // Give each layer a date based name if event = ielCreated then ievMain.Layers[layer].Name := 'Layer created at ' + DateTimeToStr( now ); end;
// Remove layer of a specific name for i := ImageEnView1.LayersCount - 1 downto 1 do if SameText( ImageEnView1.Layers[ i ].Name. aDelName ) then begin ImageEnView1.LayersRemove( i ); Break; end;
// Which is the same as... ImageEnView1.LayersRemove( ImageEnView1.LayersNameToIndex( aDelName ));