Class LineSegment
Encapsulates two points that comprise a line segment.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Base.dll
Syntax
public class LineSegment : ISerializable, IDisposable, ICloneable
Constructors
LineSegment(LineSegment)
Initializes a new instance of the LineSegment class.
Declaration
public LineSegment(LineSegment src)
Parameters
Type | Name | Description |
---|---|---|
LineSegment | src | The source instance. |
LineSegment(PointF, PointF)
Constructs a line segment given two points.
Declaration
public LineSegment(PointF ptStartPoint, PointF ptEndPoint)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStartPoint | First point in line segment. |
System.Drawing.PointF | ptEndPoint | Second point in line segment. |
LineSegment(PointF, PointF, Int32)
Constructs a line segment given two points.
Declaration
public LineSegment(PointF ptStartPoint, PointF ptEndPoint, int segmentIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStartPoint | First point in line segment. |
System.Drawing.PointF | ptEndPoint | Second point in line segment. |
System.Int32 | segmentIndex | Segment index. |
LineSegment(PointF, PointF, Orientation)
Initializes a new instance of the LineSegment class.
Declaration
public LineSegment(PointF ptStartPoint, PointF ptEndPoint, Orientation orientation)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStartPoint | The given point. |
System.Drawing.PointF | ptEndPoint | The given point. |
System.Windows.Forms.Orientation | orientation | The orientation. |
LineSegment(PointF[], Int32)
Constructs a line segment from an array of lines and a segment index.
Declaration
public LineSegment(PointF[] pts, int segIdx)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | pts | Points that make up the polyline. |
System.Int32 | segIdx | Zero-based offset of segment. |
LineSegment(SerializationInfo, StreamingContext)
Initializes a new instance of the LineSegment class.
Declaration
protected LineSegment(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The info. |
System.Runtime.Serialization.StreamingContext | context | The context. |
Fields
m_pt1
Declaration
protected PointF m_pt1
Field Value
Type |
---|
System.Drawing.PointF |
m_pt2
Declaration
protected PointF m_pt2
Field Value
Type |
---|
System.Drawing.PointF |
nSegmentIndex
The segment index.
Declaration
public int nSegmentIndex
Field Value
Type |
---|
System.Int32 |
Properties
MidPoint
Gets the midpoint of the linesegment.
Declaration
public PointF MidPoint { get; }
Property Value
Type |
---|
System.Drawing.PointF |
Point1
First point in the line segment.
Declaration
public virtual PointF Point1 { get; set; }
Property Value
Type |
---|
System.Drawing.PointF |
Point2
Second point in the line segment.
Declaration
public virtual PointF Point2 { get; set; }
Property Value
Type |
---|
System.Drawing.PointF |
Methods
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public virtual object Clone()
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
Dispose()
Declaration
public virtual void Dispose()
GetObjectData(SerializationInfo, StreamingContext)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
Declaration
protected virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The System.Runtime.Serialization.SerializationInfo to populate with data. |
System.Runtime.Serialization.StreamingContext | context | The destination (see System.Runtime.Serialization.StreamingContext) for this serialization. |
Exceptions
Type | Condition |
---|---|
System.Security.SecurityException | The caller does not have the required permission. |
GetOrthogonalIntersect(LineSegment, out PointF)
Gets the orthogonal intersect.
Declaration
public bool GetOrthogonalIntersect(LineSegment lineSeg, out PointF ptIntersect)
Parameters
Type | Name | Description |
---|---|---|
LineSegment | lineSeg | The line segment. |
System.Drawing.PointF | ptIntersect | The intersect point. |
Returns
Type |
---|
System.Boolean |
Explicit Interface Implementations
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The System.Runtime.Serialization.SerializationInfo to populate with data. |
System.Runtime.Serialization.StreamingContext | context | The destination (see System.Runtime.Serialization.StreamingContext) for this serialization. |
Exceptions
Type | Condition |
---|---|
System.Security.SecurityException | The caller does not have the required permission. |