(D): Draw Picture

This picture type is used to draw a vector-based image comprised of rendering commands for lines, circles, and rectangle shapes. The actual rendering is done with help of the ‘Stroke’ and/or ‘Fill’ command which render all previously defined shapes. To draw with different colors and line width settings, you must define multiple drawing blocks each starting with the command ‘Begin’ and then closing with stroke or fill command.

All x,y coordinates used in the drawing are in mm and relative to the center of the picture. The final picture can be later placed onto different screen locations. You can use variables instead of fixed values for each argument to dynamically change characteristic of shapes at runtime.

All dimension-relevant arguments like width, height, or radius can also be defined as percentage of the screen dimension by adding a leading ‘%’ sign to the number. For example, a width of ‘%50’ means 50% of the width of the horizontal screen dimension.

Use the scale parameter to change the overall size of a drawing without updating all relative x,y coordinates of the individual drawing commands.

Syntax:          D   [scale]

 

          scale          Multiplier for the relative x,y coordinates used in the drawing commands.  Default is 1 which means 1mm per unit.

 

 

Drawing Commands

 

Begin          Begin a new drawing block
 

Move  x, y          Move to relative position x,y without drawing a line
 

Line  x, y          Draw a line from current position to x,y.
 

Home          Draw a line from current position to first position of drawing block.
 

Rect  x, y  width  height          Draw a rectangle at position x,y with specified width and height in mm.
 

Circle  x, y  radius  [start  [end]]          Draw a circle at position x,y with specified radius in mm and start/end angle. By default a full circle will be drawn.
          start:  Angle in degrees to start circle (default 0)
          end: Angle in degrees to end circle (default 2*PI)
 

Stroke  [width  [color]]          Render all lines from current drawing block with specified width and color.
          width:  Width of line in mm (default 1mm)
          color: Color of line (default current foreground color)
 

Fill  [color]          Fill all closed shapes with specified color.
          color:  Color of fill area (default current foreground color)
 

Join  [type]          Set line connections to specified type.
          type:   miter (default) | bevel  |  round
 

End  [type]          Set line ends to specified type.
          type:  butt (default)  |  round  |  square
 

Dash  [On  [Off]]          Defines the pattern to draw lines using the specified on and off segments in mm. The default setting defines a line without dashes.
          On:  length of dash in mm (default 1)
          Off:  length of space between dashes in mm (default 0)
 

Offset  [shift  [rnd]]          Set offset for dash mode starting with distance or using random value.
          shift:  Shift in mm of starting with dash pattern (default 0)
          rnd:  0 fixed value  (default)  |  1  random value between 0 and           shift
 

AddMode  [mode]          Set rendering mode to a specified mode to influence how images are added to existing images.
          mode:  source_over  (default). 
          See html documentation about globalCompositeOperation
          for a list of available modes



Copyright 2023 - BeriSoft Inc.
All rights reserved