Name
  doc:CreateImageFromBrush -- create new image from Hollywood brush
Synopsis

      img = doc:CreateImageFromBrush(id[, table])

Function
  `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:`
    If this parameter is set to `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:`
    Here you can specify a value between 0 and 100 indicating the compression quality for the JPEG format. A value of 100 means best quality, 0 means worst quality. Defaults to 90 which means pretty good quality.

  When `doc:CreateImageFromBrush()` succeeds, it returns the handle of an image object. Otherwise, it returns `Nil` and the error handler is called.

Inputs
  id
    identifier of brush to convert into image
  table
    optional: further parameters in a table (see above)
Results
  img
    handle to an image
Errors
  `#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.

Show TOC