Name
WriteBrushPixel -- write single pixel to brush (V5.0)
Synopsis
WriteBrushPixel(id, x, y, color[, trans])
Function
This command writes the specified RGB color to the brush passed in id at the position specified in the first two arguments. If the optional argument trans is specified and the brush has a mask or an alpha channel, then the value specified in the optional argument is written to the transparency channel of the brush. If the brush has a mask, trans may be set to 0 or 1, and if the brush has an alpha channel, then trans must be in the range of 0 to 255.

You can also write pixels to brushes by selecting the brush as the output device using SelectBrush() and then call the Plot() function. Using WriteBrushPixel(), however, is faster for most cases because it allows you to modify color and transparency channels at the same time and you can also avoid the overhead that is generated by calling SelectBrush() and EndSelect().

Note that when id specifies a palette brush, color must not be an RGB color but a pen value.

Inputs
id
identifier of the brush to use
x
x offset
y
y offset
color
RGB color or pen to write to brush
trans
optional: value to copy to the transparency channel
Example
WriteBrushPixel(1, 100, 100, #RED)
Plots a red pixel at position 100:100 in brush 1.

Show TOC