LineSegment class

Applies to Windows and Windows Phone

Represents a line drawn between two points, which can be part of a PathFigure within Path data.

Inheritance

Object
  DependencyObject
    PathSegment
      LineSegment

Syntax


public sealed class LineSegment : PathSegment


<LineSegment .../>

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The LineSegment class has these types of members:

Constructors

The LineSegment class has these constructors.

ConstructorDescription
LineSegment Initializes a new instance of the LineSegment class.

 

Methods

The LineSegment class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The LineSegment class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

Point

Read/writeGets or sets the end point of the line segment.

PointProperty

Read-onlyIdentifies the Point dependency property.

 

Examples

This example creates a simple PathGeometry made up of a single PathFigure with a LineSegment and displays it using a Path element. The PathFigure object's StartPoint is set to (10,20) and a LineSegment is defined with an end point of (100,130).


<Canvas>
    <Path Stroke="Black" StrokeThickness="4">
        <Path.Data>
            <PathGeometry>
                <PathGeometry.Figures>
                    <PathFigure StartPoint="10,20">
                        <PathFigure.Segments>
                            <LineSegment Point="100,130"/>
                        </PathFigure.Segments>
                    </PathFigure>
                </PathGeometry.Figures>
            </PathGeometry>
        </Path.Data>
    </Path>
</Canvas>


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media
Windows::UI::Xaml::Media [C++]

Metadata

Windows.winmd

See also

PathSegment
Path
PathGeometry
XAML vector-based drawing sample
Quickstart: Drawing shapes

 

 

Show:
© 2014 Microsoft. All rights reserved.