getlayerstyle setlayerstyle safe way to copy a layer?

Discuss any general programming issues here

getlayerstyle setlayerstyle safe way to copy a layer?

Postby 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?
Bugala
 
Posts: 645
Joined: Sun Feb 14, 2010 8:11 pm

Re: getlayerstyle setlayerstyle safe way to copy a layer?

Postby 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.
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany


Return to General programming

Who is online

Users browsing this forum: No registered users and 5 guests