SaveBrush(id, f$[, t])
SaveBrush(id, f$[, transcolor, fmt, table])
id
to the file specified
by f$
. By default, the brush will be saved as a Windows bitmap (BMP)
file. This can be changed by passing a different format identifier to
SaveBrush()
(see below for details).
SaveBrush()
supports several optional arguments. Before Hollywood 9.0, those
had to be passed as optional parameters (see above). Since Hollywood 9.0,
however, it is recommended to use the new syntax, which has a single optional
table argument that can be used to pass one or more optional arguments to
SaveBrush()
.
The following table fields are recognized by this function:
Format:
#IMGFMT_BMP:
#IMGFMT_BMP
is the default format used by SaveBrush()
.
#IMGFMT_PNG:
#IMGFMT_JPEG:
Quality
field (see below) allows you to
specify the quality level for the JPEG image (valid values are 0 to 100
where 100 is the best quality). (V4.0)
#IMGFMT_GIF:
Colors
and Dither
tags (see below) to specify the number of
palette entries to allocate for the image and whether or not dithering
shall be applied. When using #IMGFMT_GIF
with a palette brush, no
quantizing will be done. #IMGFMT_GIF
also supports palette images
with a transparent pen. (V4.5)
#IMGFMT_ILBM:
Defaults to #IMGFMT_BMP
.
Dither:
True
to enable dithering. This field is only handled
when the destination format is palette-based and the source data
is in RGB format. Defaults to False
which means no dithering.
Depth:
Colors:
Depth
tag. Instead of a bit depth,
you can pass how many colors the image shall use here. Again,
this is only handled when the format is palette-based and the
source data is in RGB format. Valid values are between
1 and 256. Defaults to 256.
Quality:
FillColor:
#NOCOLOR
which means that transparent pixels
will be left as they are. (V9.0)
Adapter:
UserTags:
Here is an overview that shows which formats support which tags:
SaveBrush(1, "test.jpg", {Format = #IMGFMT_JPEG, Quality = 80})The code above saves brush 1 as "test.jpg" using a quality of 80%.