LineSegment Constructor (Point, Boolean)
Initializes a new instance of the
class that has the specified end LineSegment and Boolean that determines whether this Point is stroked. LineSegment
This example shows how to create a line segment. To create a line segment, use the
, PathGeometry , and PathFigure classes. LineSegment
The following examples draw a
from (10, 50) to (200, 70). The following illustration shows the resulting LineSegment ; a grid background was added to show the coordinate system. LineSegment
A LineSegment drawn from (10,50) to (200,700)
In Extensible Application Markup Language (XAML), you may use attribute syntax to describe a path.
< Path Stroke = " Black " StrokeThickness = " 1 "
Data = " M 10,50 L 200,70 " />
(Note that this attribute syntax actually creates a
, a lighter-weight version of a StreamGeometry . For more information, see the PathGeometry page.) Path Markup Syntax
In XAML, you may also draw a line segment by using object element syntax. The following is equivalent to the previous XAML example.
No code example is currently available or this language may not be supported.
< Path Stroke = " Black " StrokeThickness = " 1 " >
< Path.Data >
< PathGeometry >
< PathFigure StartPoint = " 10,50 " >
< LineSegment Point = " 200,70 " />
</ PathFigure >
</ PathGeometry >
</ Path.Data >
</ Path >
This example is part of larger sample; for the complete sample, see the
Geometries Sample. .NET Framework
Supported in: 4.6, 4.5, 4, 3.5, 3.0
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.