Name
ChangeBrushTransparency -- change transparency mode of brush (V5.0)
Synopsis
ChangeBrushTransparency(id, mode)
Function
This command can be used to change the transparency mode of a brush. Hollywood currently supports three different transparency modes:

#NONE:
No transparency. The entire brush is visible.

#MASK:
Monochrome transparency. Every pixel can either be visible or invisible.

#ALPHACHANNEL:
Gradual transparency. Every pixel can have 256 different levels of transparency. An alpha channel value of 0 means full transparency, whereas an alpha channel value of 255 means no transparency.

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.

Inputs
id
brush whose transparency mode you want to change
mode
desired new transparency; can be #NONE, #MASK, or #ALPHACHANNEL
Example
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.

Show TOC