table = BrushToRGBArray(id[, invalpha])
Note that the rows won't be stored as subtables. The table returned by
BrushToRGBArray()
will be one-dimensional and will contain exactly
$height * $width elements, stored sequentially, row after row.
The optional argument invalpha
can be used to tell BrushToRGBArray()
that all alpha channel values shall be inverted. This means that a value
of 0 means 100% visibility and a value of 255 means invisibility. Normally,
it is just the other way round. Due to historical reasons, the Hollywood
drawing library uses inverted alpha values, and this why they are also
supported by BrushToRGBArray()
, although they are not the default.
Please note that the table that you get from this function will usually eat lots of memory. Thus, you should set this table to Nil as soon as you no longer need it. Otherwise you will waste huge amounts of memory and it could even happen that your script runs out of memory altogether. So please keep in mind that you should always set pixel array tables to Nil as soon as you are done with them.
To convert a pixel array back to a brush, you can use the RGBArrayToBrush() function.
Note that for palette brushes, there is also the BrushToPenArray() function which will return the brush's pen values instead of RGB colors. See BrushToPenArray for details.
False
which means do not invert alpha values)