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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Duplicate multiple selected layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Oct 01 2020 :  07:15:57  Show Profile  Reply
Hello,

In my software I am allowing user to select multiple layers. After selecting multiple layers if the user tries to duplicate layer only the last selected layer is getting duplicated. Actually all the selected layers (along with their masks) should get duplicated.

What is the best way to do this?

TIA


Yogi Yang

xequte

38988 Posts

Posted - Oct 02 2020 :  21:04:44  Show Profile  Reply
Hi Yogi

What method is being used to duplicate the layers?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
727 Posts

Posted - Oct 05 2020 :  06:47:22  Show Profile  Reply
Hello Nigel,

I am using LayersCreateFromSelection.

Is there any better way to do this?

TIA


Yogi Yang
Go to Top of Page

xequte

38988 Posts

Posted - Oct 06 2020 :  16:23:59  Show Profile  Reply
Hi Yogi

LayersCreateFromSelection() only makes a single image layer from the selection content in another image layer. That doesn't sound like what you are trying to do.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
727 Posts

Posted - Oct 07 2020 :  09:15:04  Show Profile  Reply
Hello Nigel,

After your last post in this thread I got the idea to build an array of selected layers and then add them using something like this snippet:

ieViewMain.LayersAdd(ieViewMain.Layers[idx].Bitmap);
ieViewMain.CurrentLayer.PosX := ieViewMain.Layers[idx].PosX;
ieViewMain.CurrentLayer.PosY := ieViewMain.Layers[idx].PosY;


And this is working but I would like to know if there is a better solution to achieve this.

TIA


Yogi Yang
Go to Top of Page

xequte

38988 Posts

Posted - Oct 08 2020 :  00:46:05  Show Profile  Reply
Hi Yogi

To understand this better, is this a function like "Duplicate" selected layers?

There is a LayersAdd overload to clone a layer.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: