Skip to content
Jean-Philippe Bruyère edited this page Oct 26, 2021 · 2 revisions

String Parser for drawing shape

All fields are separated by one or more space. Each statement is composed of one letter followed by 0 to n double parameters. The following list enumerate available instructions:

  • M x y: Move to (x,y) absolute coordinate.
  • m x y: Relative move to by x in the horizontal direction and y in the vertical.
  • L x y: Line to (x,y)
  • l x y: trace line from current point by moving pen by x and y in each direction.
  • R x y w h: draw rectangle at (x,y) with width and height equal to w and h.
  • C x1 y1 x2 y2 x3 y3: draw bezier curve with current point as first control point, and parameters as others.
  • c x1 y1 x2 y2 x3 y3: draw bezier curve with control points relative to current position.
  • A x y r a1 a2: draw positive arc at (x,y) with radius r from angle a1 to angle a2.
  • N x y r a1 a2: draw negative arc at (x,y) with radius r from angle a1 to angle a2.
  • Z: close path
  • F: fill path.
  • f: fill preserve.
  • G: stroke path.
  • g: stroke preserve.
  • S x: set line width to x.
  • O r g b a: set solid color as source with rgba values.

namespace: Crow

Inheritance Hierarchy

  • PathParser

Syntax

public class PathParser

Constructors

prototype description
PathParser (string str) __

Properties

name description

Methods

prototype description
void Draw(Context gr, bool measure=false) __

Events

name description
Clone this wiki locally