Appendix H. Path Mini-Language

This appendix summarizes the Path mini-language (or path markup syntax) that you can use to concisely define the lines and curves drawn by Path objects. Place mini-language commands in the Path control's Data property.

Table H-1 describes the Path mini-language's commands. Uppercase versions use absolute coordinates, while lowercase versions use points relative to the previous points.

Table H.1. Path Mini-Language Commands

Command

Meaning

F0

Use Odd/Even fill rule. (See Figure H-1.)

F1

Use Non-Zero fill rule. (See Figure H-1.)

M or m

Move to the following point.

L or l

Draw lines to the following points.

H or h

Draw a horizontal line to the given X coordinate.

V or v

Draw a vertical line to the given Y coordinate.

C or c

Draw a cubic Bézier curve. This command takes three points as parameters: two control points and an endpoint. The curve starts at the current point moving toward the first control point and ends at the endpoint moving away from the second control point. (See Figure H-2.)

S or s

Draw a smooth Bézier curve. This command takes two points as parameters: a control point and an endpoint. The curve defines an initial control point by reflecting the final control point from the previous S command. It then draws a cubic Bézier curve using the newly defined control point and the two parameter points. This makes the second curve smoothly join with the previous one. (See Figure H-2.)

Q or q

Draw a quadratic Bézier curve. This command takes two points as parameters: ...

Get WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.