Skip to content

GEN_MODELTYPE_ICON_STR

GEN_MODELTYPE_ICON_STR generates a model type icon graphics to a base64 encoded string.

Syntax

leo-grammar
CC "Drawing" GEN_MODELTYPE_ICON_STR	modeltype:strValue [ gfx-format:ImageType ]
									[ bgcolor:ColorSpec ] [ transparent ]
									[ bpp:intValue ] [ quality:intValue ]
									[ modified:boolValue ]
									[ favorite:boolValue ]
									[ protected:boolValue ]
									[ cycle:boolValue ]
									[ locked:boolValue ]
									[ unlocked:boolValue ]

ImageType :	"bmp" | "gif" | "ico" | "jpeg" | "png" 
			"targa" | "tiff" | "wbmp" | "xpm" .


ColorSpec :		ColorValue | ColorName .

ColorValue :	intValue | "ColorName" .
CC "Drawing" GEN_MODELTYPE_ICON_STR	modeltype:strValue [ gfx-format:ImageType ]
									[ bgcolor:ColorSpec ] [ transparent ]
									[ bpp:intValue ] [ quality:intValue ]
									[ modified:boolValue ]
									[ favorite:boolValue ]
									[ protected:boolValue ]
									[ cycle:boolValue ]
									[ locked:boolValue ]
									[ unlocked:boolValue ]

ImageType :	"bmp" | "gif" | "ico" | "jpeg" | "png" 
			"targa" | "tiff" | "wbmp" | "xpm" .


ColorSpec :		ColorValue | ColorName .

ColorValue :	intValue | "ColorName" .
leo-grammar
# --> RESULT ecode:intValue gfx:strValue .
# --> RESULT ecode:intValue gfx:strValue .

Parameters

  • modeltype (strValue) - the name of the model type of which the icon graphics shall be generated.
  • gfx-format (enumValue, optional) - specifies the used image format (see table below). Default is "png".
  • bgcolor (ColorSpec, optional) - the background color. This is ignored when bpp is 32, as this means that the background will be transparent. More information about the color can be found here.
  • transparent (modifier, optional) -
  • bpp (intValue, optional) - value sets the number of bits per pixel.
  • quality (intValue, optional) - only applies for jpeg graphics and specifies the compression rate. A value of 100 (percent) means lossless graphics with lage files. The default value is 50.
  • modified (boolValue, optional) - red coloring for showing "modified" status. Can be usd with boolValues or as modifier.
  • favorite (boolValue, optional) - yellow star at the top right-hand side. Can be usd with boolValues or as modifier.
  • protected (boolValue, optional) - lock at the bottom right-hand side. Can be usd with boolValues or as modifier.
  • cycle (boolValue, optional) - blue arrow at the top right side. Can be usd with boolValues or as modifier.
  • locked (boolValue, optional) - forbidden sign. Can be usd with boolValues or as modifier.
  • unlocked (boolValue, optional) - check mark. Can be usd with boolValues or as modifier.

Returns

  • ecode (intValue) - Contains the error code or is 0 in case of success.
  • gfx (strValue) - contains the generated graphics as base64 encoded string.

Details

The supported bpp values depend on the used graphics format (see table below). For graphics formats which support just one bpp value, the value of this parameter is ignored. If an unsupported bpp value is given, the default bpp value of the specified gfx format is used, which is 8 for GIF, 1 for WBMP and 24 for any other gfx format.

Gfx formats and supported bpp values

"bmp" - Windows Bitmap (1, 4, 8, 16, 24, 32)
"gif" - Graphics Interchange Format (8)
"ico" - Windows Icon (1, 4, 8, 16, 24, 32)
"jpeg" - JPEG graphics format (8, 24)
"png" - Portable Network Graphics (1, 4, 8, 24, 32)
"targa" - Truevision Targa (8, 16, 24, 32)
"tiff" - Tagged Image File Format (1, 4, 8, 24, 32)
"wbmp" - Wireless Bitmap (1)
"xpm" - X11 Pixmap (24)

If gfx-format is "gif" and transparent is true, the background color palette entry is used as transparency indicator. For other formats transparent is ignored.

See Also

color names

Examples

Example 1

asc
CC "Drawing" GEN_MODELTYPE_ICON_STR
        modeltype:"Business process" gfx-format:"png" bpp:32
CC "AdoScript" FWRITE file:"d:\\BP.png" text:(gfx) base64
CC "Drawing" GEN_MODELTYPE_ICON_STR
        modeltype:"Business process" gfx-format:"png" bpp:32
CC "AdoScript" FWRITE file:"d:\\BP.png" text:(gfx) base64

Example 2

leo-grammar
CC "Drawing" GEN_MODELTYPE_ICON_STR
        modeltype:"Business process" gfx-format:"gif"
        bgcolor:pink transparent
CC "AdoScript" FWRITE file:"d:\\BP.gif" text:(gfx) base64
CC "Drawing" GEN_MODELTYPE_ICON_STR
        modeltype:"Business process" gfx-format:"gif"
        bgcolor:pink transparent
CC "AdoScript" FWRITE file:"d:\\BP.gif" text:(gfx) base64

Versions and Changes

Available since ADOxx 1.3