Back to Aurora Vision Studio website

You are here: Start » Filter Reference » Image » Image Drawing » DrawStrings_MultiColor

DrawStrings_MultiColor


Module: FoundationLite

Draws strings (text) on an image with multiple colors.

Name Type Range Description
Input value inImage Image Input image
Input value inStrings String?Array? String to draw
Input value inLocations Location?Array? Center point of each string to draw
Input value inLocationAlignment CoordinateSystem2D*
Input value inLocationAnchor Anchor2D
Input value inColorIds Hash?Array*
Input value inPalette PixelArray*
Input value inDrawingStyle DrawingStyle
Input value inSize Real 10.0 - Height of a character in pixels
Input value inOrientationAngle Real Orientation of text in degrees
Input value inForceRgb Bool Filter will convert monochromatic image to RGB if needed
Input value inBackgroundColor Pixel* Color of pixels drawn on image in text row
Output value outImage Image Output image

Description

The operation draws a strings on the inImage aligning the inLocationAnchor location of the text at the inLocations of the inImage. The height of the font is fixed and equals 16 pixels.

Hints

  • Connect an image source to the inImage input. Drawing will be done on this image.
  • If you want to draw on an empty background, use EmptyImage filter before.
  • Define inStrings. This will be the primitives to be drawn.
  • For each of the strings also define its location by setting the inLocations input.
  • If the locations provided on the inLocations input are in a local coordinate system, also set the inLocationAlignment input.
  • Set inLocationAnchor do define how each of the strings should be aligned in relation to its location.
  • Define the font size by setting the inSize input. Recommended values are: 16, 32, 48, 64.
  • Leave the inPalette and inColorIds not set to have all the primitives drawn with random colors. Set a custom array of colors here to decide explicitly how each of the primitives should be drawn using inColorIds.
  • Set inForceRgb to True, if you want to get a 3-channel output regardless of what is on the input.
  • Set inDrawingStyle to control quality, opacity, thickness, filling, point shapes and sizes.

Examples

Description of usage of this filter can be found in examples and tutorial: Cap (Easy), Waffles, Washers, Brick destroy (Game), Cap (Advanced), Bottle Inspector Part 1: Counting Bottles, Conditions in Formulas.

Example usage of the DrawStrings_MultiColor on an empty image.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Empty inPalette while inStrings has objects to draw in DrawStrings_MultiColor.
DomainError inStrings and inLocations arrays do not match in DrawStrings_MultiColor.
DomainError No palette defined with inPalette for specified inColorIds in DrawStrings_MultiColor.
DomainError The sizes inStrings and inColorIds do not match in DrawStrings_MultiColor.

Complexity Level

This filter is available on Advanced Complexity Level.

Filter Group

This filter is member of DrawStrings filter group.

See Also