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
 Cannot understand why RemoveLayer throws out of bounds error ?

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
andyhill Posted - Aug 25 2022 : 21:47:53
I have many text layers

procedure TfMain.ImageEnView1LayerNotifyEx(Sender: TObject; layer: Integer; event: TIELayerEvent);

...

for i:= 0 to ImageEnView1.LayersCount-1 do begin
ALayer:= ImageEnView1.Layers[i];
if ( (ALayer.Locked = False)
and (ALayer.Selected = True)
and (ALayer.Kind = ielkText)
) then begin

do my thing

ImageEnView1.Deselect;
// ImageEnView1.LockUpdate;
ImageEnView1.LayersRemove(i); // throws errors ?
// ImageEnView1.UnlockUpdate;
ImageEnView1.Update();




Andy
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 28 2022 : 00:20:33
Yes, as Kolio states. Iterate downward.

Nigel
Xequte Software
www.imageen.com
kolio Posted - Aug 26 2022 : 13:36:05
try
for i:= ImageEnView1.LayersCount-1 downto 0 ....