Path Class Home
This page is specific to:Microsoft Version:3.03.5Silverlight 34.0
.NET Framework Class Library for Silverlight
Path Class

Draws a series of connected lines and curves. The line and curve dimensions are declared through the Data property, and can be specified either with a Path-specific mini-language, or with an object model.

Namespace:  System.Windows.Shapes
Assembly:  System.Windows (in System.Windows.dll)
Syntax

'Usage

Dim instance As Path

'Declaration

Public NotInheritable Class Path _
    Inherits Shape
<Path .../>
Remarks

Fundamentally, a Path is a Shape. But the Path can be used to create much more complex two-dimensional graphics than the other Shapes are capable of. The Path object can draw closed or open shapes, lines, and curves. For a description of the shapes that the Path element supports, see the Data property.

A Path supports two parallel techniques for declaring its contents: as an object model using discrete geometries declared in markup or code, or as a mini-language declared in markup. The geometry object model can use the GeometryGroup as data in order to specify a composite of multiple geometries. For details, see Geometries. The mini-language is analogous to a pathing language output used in some graphics tools. For more information on using the mini-language definition format for Path in markup, see Path Markup Syntax.

NoteNote:

Performance Note: For best performance, avoid explicitly setting the Width and Height of a Path. Setting the Width and Height results in additional stretching, which has a performance cost. Instead, rely on the explicitly set coordinates of the Path and its contained data to control its shape and position. In effect, the Path will have a natural height/width, although those values are not reported to the object model. For more information, see Stretch.

Examples

The following example uses a Path to draw an ellipse.

An EllipseGeometry drawn at (50,50)

ms615632.JOLT_ellipse_with_center(en-us,VS.95).png
<Canvas> 
  
  <Path Fill="Gold" Stroke="Black" StrokeThickness="1">
    <Path.Data>
      <EllipseGeometry Center="50,50" RadiusX="50" RadiusY="50" />
    </Path.Data>
  </Path> 
</Canvas>
Inheritance Hierarchy

System..::.Object
  System.Windows..::.DependencyObject
    System.Windows..::.UIElement
      System.Windows..::.FrameworkElement
        System.Windows.Shapes..::.Shape
          System.Windows.Shapes..::.Path
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Other Resources

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View