#521 – Pen and Pencil Tools Both Generate Path Elements

Whether you use the Pen tool or the Pencil tool in Blend, you’re generating a Path element, which just defines a series of line segments or curves.  Using either tool in Blend results in the Data attribute of a Path element being set to a string containing markup that represents individual drawing commands.

In the example below, the first Path was created using the Pen tool, while the second Path was created using the Pencil tool.  Looking at the Path elements in XAML, there’s no information telling you which tool Blend used to create the corresponding XAML.

You can also use the Direct Selection tool on either Path to modify individual points.  The path created using the Pencil tool will typically have more points, since it puts down a series of points as you drag your mouse pointer.


#519 – Adding Points to an Existing Path

You can add points to an existing Path object in Blend by using the Pen tool.

Start by selecting the existing path.  First, click on the Selection tool in the tools panel.  

Then left-click to select the existing path.

Now, click on the Pen tool.  

At this point, you can add points to create a new Path object, or add points to the existing Path.  You’ll notice that if you hover the cursor over the existing path, it changes so that it include a little “+”, rather than an “x”.  The “+” indicates that you can add a point to the path.

If you left-click on the path, you’ll add a new point at this location on the curve.

You can also delete existing points by hovering over them and left-clicking.

#517 – XAML Output when Drawing with the Pen Tool

When you use the Pen tool in Blend to draw a path, Blend will generate a Path element in the corresponding XAML for the window or page.  The data representing the geometry of the actual path is located in the Data attribute of the Path element.

#516 – Drawing a Path in Blend with the Pen Tool

You can use the Pen tool in Blend to draw a Path object.  A path is just a series of connected line segments or curves.  You draw a Path by specifying a series of individual points.

To start drawing a Path, first select the Pen tool in the tools panel.

You can now left-click on the artboard to place the first point.  After you click, you’ll see the point rendered as a square blue dot.

Left-click again to place the second point, holding the left mouse button down after you click.  You’ll see a straight line segment appear, but if you drag the mouse while holding down the left button, you can create a curve.

Continue in the same way, adding curves that each connects to the end of the previous curve.

You can leave the Path object open, or click on the original point to close the curve.