getlayerstyle setlayerstyle safe way to copy a layer?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 661
Joined: Sun Feb 14, 2010 8:11 pm

getlayerstyle setlayerstyle safe way to copy a layer?

Post by Bugala » Thu Aug 17, 2017 3:35 pm

As i couldnt find any "CopyLayer" command. I was wondering if this would be a safe way to do it:

Code: Select all

newlayerid = InsertLayer(0, #BRUSH, 1, 1, 1)
t = GetLayerStyle(layertobecopiedID)
SetLayerStyle(newlayerid, t)
Or do i have to take something into consideration, like is there some piece of information missing from layerstyle infos?

User avatar
airsoftsoftwair
Posts: 2484
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: getlayerstyle setlayerstyle safe way to copy a layer?

Post by airsoftsoftwair » Sat Aug 19, 2017 12:14 pm

Hmm, interesting approach. I'm not sure it will work 100% for all layer types, though, although in theory it should. If you have a case where it doesn't work, just post.

Post Reply