ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to NOT remove the background image with LayersRemove?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Nov 07 2021 : 11:43:56
ImageEnView1.LayersRemove(LYR_SELECTED_LAYERS) sometimes (randomly) removes the BACKGROUND IMAGE together with the selected layer(s).

How can I avoid this?

I now use this workaround to remove the selected layer(s) without removing the background image:

for var i := ImageEnView1.LayersCount - 1 downto 1 do
begin
  if ImageEnView1.Layers[i].Selected then
    ImageEnView1.LayersRemove(i);
end;

This works. But isn't there a built-in method to achieve this?
4   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Nov 08 2021 : 19:26:40
Thank you!
xequte Posted - Nov 08 2021 : 17:53:44
Hi Peter

If imgMain.Layers[0].Selectable = False, you can still make a selection (miSelect) on the background image, but you have to make it the active layer with code. If it is selectable then it is at risk of being removed using LayersRemove(LYR_SELECTED_LAYERS).

You can add loProtectBackground to LayerOptions which will protect it from user actions, such as the Delete key. For the next beta, that will also protect it in the case of LayersRemove(LYR_SELECTED_LAYERS).


Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Nov 08 2021 : 08:13:11
imgMain.Layers[0].Selectable := False
This seems to block the creation of any selection on the background image (!)

Yes, loAllowMultiSelect is included.
xequte Posted - Nov 07 2021 : 22:09:54
Hi

Does ImageEnView1.Layers[0].Selectable = False?
Is loAllowMultiSelect in ImageEnView1.LayerOptions?



Nigel
Xequte Software
www.imageen.com