menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class BezierSegment - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class BezierSegment

    Represents the bezier segment of the connector.

    Inheritance
    System.Object
    DiagramObject
    ConnectorSegment
    StraightSegment
    BezierSegment
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    ConnectorSegment.AllowDrag
    ConnectorSegment.Type
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    StraightSegment.Point
    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 X = 0, Y = 0.

    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 X = 0, Y = 0.

    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 Angle = 0 and Distance = 0.

    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 Angle = 0 and Distance = 0.

    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.

    Overrides
    StraightSegment.Clone()

    Implements

    IDiagramObject
    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved