Skip to main content

StaticGraymap v5.4

An embedded grayscale image. The gray value of each pixel is the intensity of the foreground color: white (255) paints the full foreground color, and black (0) paints nothing. Unlike StaticBitmap, which is black and white, this makes it possible to paint shades of a single color.

Mandatory properties​

The following properties are available in addition to the common label object properties.

PropertyTypeDescription
typestringMust be StaticGraymap.
graymapstringBase64-encoded 8-bit grayscale PNG image.
widthnumberWidth of the image area.
heightnumberHeight of the image area.

Optional properties​

The following properties are available in addition to the common label object properties.

PropertyTypeDescription
fgColorstringForeground color. May contain dynamic text. Default is black.
bgColorstringOptional background color. May contain dynamic text.
thresholdingbooleanIf true, pixels with a gray value above 127 are painted with the full foreground color, and other pixels are not painted. Default is false.

Example​

A horizontal gradient from no color to full red:

{
"type": "StaticGraymap",
"x": 10.0,
"y": 10.0,
"width": 40.0,
"height": 10.0,
"fgColor": "red",
"graymap": "iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAAAAADcV1ARAAAADUlEQVR4nGNgCF31HwADVwH/LWZy7wAAAABJRU5ErkJggg=="
}