Converting a Layer to a Brush Together with Effects. Also, Bug in CreateBorderBrush()

Feature requests for future versions can be voiced here
Post Reply
PEB
Posts: 263
Joined: Sun Feb 21, 2010 1:28 am

Converting a Layer to a Brush Together with Effects. Also, Bug in CreateBorderBrush()

Post by PEB » Mon Oct 21, 2019 3:45 am

This post includes a feature request and a bug report. (Andreas: I can separate these into different posts if you prefer.)

If I apply effects (such as border and shadow) to a layer, and then want to transfer the way that layer looks into brush, I can get pretty close by using CreateBorderBrush() and CreateShadowBrush().

Try this code:

Code: Select all

TextOut(#CENTER, #CENTER, "Test", {Name="Text", AnchorX=0.5, AnchorY=0.5})
SetLayerStyle("Text", {Font=#SERIF, FontSize=56, Color=$0, FontStyle=#ANTIALIAS, Border=True, BorderColor=ARGB(120, #YELLOW), BorderSize=5, Shadow=True, ShadowColor=ARGB(200, $0), ShadowSize=3})

ConvertToBrush(#LAYER, "Text", 1)
CreateBorderBrush(2, 1, ARGB(120, #YELLOW), 5)
CreateShadowBrush(3, 2, ARGB(200, $0), 3)

DisplayBrush(3, #CENTER+3, #CENTER+75+3)
DisplayBrush(2, #CENTER, #CENTER+75)
DisplayBrush(1, #CENTER, #CENTER+75)
Here's the bug report: CreateBorderBrush() doesn't seem to apply the alpha transparency value specified in ARGB().

Here's the feature request: Would it be possible to extend ConvertToBrush() in order to include the layer effects in use, and thus more quickly and accurately reproduce the exact look of the layer in the form of a brush?

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

Re: Converting a Layer to a Brush Together with Effects. Also, Bug in CreateBorderBrush()

Post by airsoftsoftwair » Mon Oct 21, 2019 9:19 pm

PEB wrote:
Mon Oct 21, 2019 3:45 am
This post includes a feature request and a bug report. (Andreas: I can separate these into different posts if you prefer.)
Yes, I'd prefer to keep feature requests and bug reports separate. And you also posted it in the wrong forum, btw :)
PEB wrote:
Mon Oct 21, 2019 3:45 am
If I apply effects (such as border and shadow) to a layer, and then want to transfer the way that layer looks into brush, I can get pretty close by using CreateBorderBrush() and CreateShadowBrush().
...
Here's the bug report: CreateBorderBrush() doesn't seem to apply the alpha transparency value specified in ARGB().
Thanks, will be fixed.
PEB wrote:
Mon Oct 21, 2019 3:45 am
Here's the feature request: Would it be possible to extend ConvertToBrush() in order to include the layer effects in use, and thus more quickly and accurately reproduce the exact look of the layer in the form of a brush?
Should be possible. I'll see what I can do.

PEB
Posts: 263
Joined: Sun Feb 21, 2010 1:28 am

Re: Converting a Layer to a Brush Together with Effects. Also, Bug in CreateBorderBrush()

Post by PEB » Tue Oct 22, 2019 12:18 am

Thanks!

Post Reply