Class BezierSegment
Represents the bezier segment of the connector.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class BezierSegment : StraightSegment, IDiagramObject, ICloneable
Remarks
The BezierSegment is a specialized segment used in Connectors for bezier connections, providing enhanced control through control points.
Examples
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Bezier,
Segments=new DiagramObjectCollection<ConnectorSegment>()
{
new BezierSegment(){Type=ConnectorSegmentType.Bezier,
Point1=new DiagramPoint{X=125, Y=75},
Point2=new DiagramPoint{X=225, Y=75} }
}
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
Constructors
BezierSegment()
Initializes a new instance of the BezierSegment.
Declaration
public BezierSegment()
BezierSegment(BezierSegment)
Creates a new instance of the BezierSegment from the given BezierSegment.
Declaration
public BezierSegment(BezierSegment src)
Parameters
Type | Name | Description |
---|---|---|
BezierSegment | src | BezierSegment |
Properties
Point1
Gets or sets the first control point of the bezier connector.
Declaration
public DiagramPoint Point1 { get; set; }
Property Value
Type | Description |
---|---|
DiagramPoint | A DiagramPoint representing the first control point. The default value is at |
Remarks
This control point affects the curvature of the bezier path. Ensure the point is set correctly to achieve desired bezier shapes.
Examples
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Bezier,
Segments=new DiagramObjectCollection<ConnectorSegment>()
{
new BezierSegment(){Type=ConnectorSegmentType.Bezier,
Point1=new DiagramPoint{X=125, Y=75},
Point2=new DiagramPoint{X=225, Y=75 } }
}
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
Point2
Gets or sets the second control point of the bezier connector.
Declaration
public DiagramPoint Point2 { get; set; }
Property Value
Type | Description |
---|---|
DiagramPoint | A DiagramPoint representing the second control point. The default value is at |
Remarks
This control point, alongside Point1, determines the final shape and crest of the bezier curve.
Examples
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Bezier,
Segments=new DiagramObjectCollection<ConnectorSegment>()
{
new BezierSegment(){Type=ConnectorSegmentType.Bezier,
Point1=new DiagramPoint{X=125, Y=75},
Point2=new DiagramPoint{X=225, Y=75 } }
}
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
Vector1
Gets or sets the length and angle between the source point and the first control point of the diagram.
Declaration
public Vector Vector1 { get; set; }
Property Value
Type | Description |
---|---|
Vector | A Vector that specifies the distance and direction from the source point to the first control point.
Initialized with |
Remarks
Modifying this vector shifts the first control point accordingly, thereby affecting the bezier curve's initial segment direction.
Examples
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Bezier,
Segments=new DiagramObjectCollection<ConnectorSegment>()
{
new BezierSegment(){Type=ConnectorSegmentType.Bezier,
Vector1=new Vector{Angle=90, Distance=75 },
Vector2=new Vector{Angle=90, Distance=75 }
}
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
Vector2
Gets or sets the length and angle between the target point and the second control point of the diagram.
Declaration
public Vector Vector2 { get; set; }
Property Value
Type | Description |
---|---|
Vector | A Vector that specifies the distance and direction from the target point to the second control point.
Initialized with |
Remarks
Adjusting this vector affects how sharply the bezier curve approaches the target point.
Examples
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Bezier,
Segments=new DiagramObjectCollection<ConnectorSegment>()
{
new BezierSegment(){Type=ConnectorSegmentType.Bezier,
Vector1=new Vector{Angle=90, Distance=75 },
Vector2=new Vector{Angle=90, Distance=75 }
}
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
Methods
Clone()
Creates a new bezier segment that is a copy of the current segment.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A BezierSegment that is a copy of this instance. |