ChangeBrushTransparency(id, mode)
#NONE:
#MASK:
#ALPHACHANNEL:
ChangeBrushTransparency()
is especially useful for switching between
the #MASK
and #ALPHACHANNEL
modes. For example, when you load a brush
using LoadBrush() and you use the Transparency
tag to make a color
transparent, you will always get a brush that has a #MASK
transparency
mode. However, in some cases you might want the brush to use a mode of
#ALPHACHANNEL
instead; because you want to modify the values using
SelectAlphaChannel(), for example. In that case, ChangeBrushTransparency()
can be quite helpful.
Note that this function cannot be used with palette brushes.
#NONE
, #MASK
, or
#ALPHACHANNEL
LoadBrush(1, "test.iff", {Transparency = #RED}) ChangeBrushTransparency(1, #ALPHACHANNEL)The code above loads the image "test.iff" into brush 1, makes color red transparent, and then changes the transparency mode from
#MASK
to #ALPHACHANNEL
.