Converting a Layer to a Brush Together with Effects. Also, Bug in CreateBorderBrush()
Posted: 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:
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?
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 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?