Name
SetBrushTransparency -- define transparent color of a brush (V1.5)
Synopsis
SetBrushTransparency(id, col)
Function
This function makes the color specified by col transparently in the brush with the number id. This is done by creating a mask for the brush. SetBrushTransparency() will scan through all pixels of the brush and mask out all pixels that have the specified color. The mask that is created by this function is not automatically updated when you call SelectBrush() to modify pixels of your brush. Hence, it is necessary to call SetBrushTransparency() again after a call to SelectBrush(), so that the mask can be updated, too.

You can also use this function to remove a mask from a brush. Just specify #NOTRANSPARENCY as the color.

Inputs
id
source brush id
col
color to be displayed transparently or #NOTRANSPARENCY to kill the brush's mask
Example
CreateBrush(1, 320, 256)
SelectBrush(1)
SetFillStyle(#FILLCOLOR)
Circle(0, 0, 100, #RED)
EndSelect()
SetBrushTransparency(1, #BLACK)
MoveBrush(1, #CENTER, #BOTTOMOUT, #CENTER, #TOPOUT, 10)
The above code creates a brush, draws a filled circle on it and then sets the background color black as transparent color. After that it scrolls the circle through the screen. It is important that you call SetBrushTransparency() when output is done, i.e. after calling EndSelect().

Show TOC