A draw command can consist of several shape commands. The following shape commands are available: line, horizontal line, vertical line, cubic Bezier curve, quadratic Bezier curve, smooth cubic Bezier curve, smooth quadratic Bezier curve, and elliptical arc.
You enter each command by using either an uppercase or a lowercase letter: uppercase letters denote absolute values and lowercase letters denote relative values: the control points for that segment are relative to the end point of the preceding example. When sequentially entering more than one command of the same type, you can omit the duplicate command entry; for example, L 100,200 300,400 is equivalent to L 100,200 L 300,400. The following table describes the move and draw commands.
Line Command
Creates a straight line between the current point and the specified end point. l 20 30 and L 20,30 are examples of valid line commands.
| Syntax |
| L endPoint - or - l endPoint |
Horizontal Line Command
Creates a horizontal line between the current point and the specified x-coordinate. H 90 is an example of a valid horizontal line command.
Vertical Line Command
Creates a vertical line between the current point and the specified y-coordinate. v 90 is an example of a valid vertical line command.
Cubic Bezier Curve Command
Creates a cubic Bezier curve between the current point and the specified end point by using the two specified control points (controlPoint1 and controlPoint2). C 100,200 200,400 300,200 is an example of a valid curve command.
| Syntax |
| C controlPoint1 controlPoint2 endPoint - or - c controlPoint1 controlPoint2 endPoint |
Quadratic Bezier Curve Command
Creates a quadratic Bezier curve between the current point and the specified end point by using the specified control point (controlPoint). q 100,200 300,200 is an example of a valid quadratic Bezier curve command.
| Syntax |
| Q controlPoint endPoint - or - q controlPoint endPoint |
Smooth cubic Bezier curve Command
Creates a cubic Bezier curve between the current point and the specified end point. The first control point is assumed to be the reflection of the second control point of the previous command relative to the current point. If there is no previous command or if the previous command was not a cubic Bezier curve command or a smooth cubic Bezier curve command, assume the first control point is coincident with the current point. The second control point, the control point for the end of the curve, is specified by controlPoint2. For example, S 100,200 200,300 is a valid smooth cubic Bezier curve command.
| Syntax |
| S controlPoint2 endPoint - or - s controlPoint2 endPoint |
Smooth quadratic Bezier curve Command
Creates a quadratic Bezier curve between the current point and the specified end point. The control point is assumed to be the reflection of the control point of the previous command relative to the current point. If there is no previous command or if the previous command was not a quadratic Bezier curve command or a smooth quadratic Bezier curve command, the control point is coincident with the current point.
| Syntax |
| T controlPoint endPoint - or - t controlPoint endPoint |
Elliptical Arc Command
Creates an elliptical arc between the current point and the specified end point.
| Syntax |
| A size rotationAngle isLargeArcFlag sweepDirectionFlag endPoint - or - a size rotationAngle isLargeArcFlag sweepDirectionFlag endPoint |
| Term | Description |
| size | System.Windows..::.Size The x- and y-radius of the arc. |
| rotationAngle | System..::.Double The rotation of the ellipse, in degrees. |
| isLargeArcFlag | Set to 1 if the angle of the arc should be 180 degrees or greater; otherwise, set to 0. |
| sweepDirectionFlag | Set to 1 if the arc is drawn in a positive-angle direction; otherwise, set to 0. |
| endPoint | System.Windows..::.Point The point to which the arc is drawn. |