img = doc:CreateImageFromBrush(id[, table])
doc:CreateImageFromBrush()
creates an image from the Hollywood brush specified by id
. The image
will always use the RGB color space, i.e. #HPDF_CS_DEVICE_RGB
.
The optional argument table
can be used to configure further options:
UseJPEG:
True
, the image will be compressed using the JPEG file format.
You can use the Quality
field to set the compression level. If UseJPEG
is set to False
,
the image won't be compressed, but you can use doc:SetCompressionMode() to activate
compression for image data, although this won't be as good as JPEG. Defaults to False
.
Quality:
When doc:CreateImageFromBrush()
succeeds, it returns the handle of an image object. Otherwise, it
returns Nil
and the error handler is called.
#HPDF_INVALID_DOCUMENT
- An invalid document handle was set.
#HPDF_FAILED_TO_ALLOC_MEM
- Memory allocation failed.
#HPDF_INVALID_COLOR_SPACE
- An invalid color_space value is specified.
#HPDF_INVALID_IMAGE
- The size of an image data is invalid.