Currently I am trying to name / rename a layer by clicking a button next to an imageenmview component showing all of the layers, then typing in a text box to put in a name for the current layer then click save to name the layer. The problem I have is that it all works except all of the layers within the imageenmview show the name instead of the selected one and it doesnt save the name with the layers when the image is saved. Is there something I am doing incorrect? Below is my code:
i:= imgview1.LayersCurrent;
imgview1.currentlayer.Name := layernametext.Text;
imgview1.update;
/// this part is for loading or refreshing the layer viewer
for i := 0 to Imgview1.LayersCount - 1 do
begin
idx := ImageEnMView1.AppendImage;
ImageEnMView1.SetIEBitmap(idx, Imgview1.Layers[i].Bitmap);
ImageEnMView1.ImageTopText[i] := inttostr(i) + ' '+ imgview1.CurrentLayer.name;
end;
ImageEnMView1.SelectedImage := Imgview1.LayersCurrent;