Class BasicShape
Gets or sets the behavior of the basic shape.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class BasicShape : Shape, IDiagramObject, ICloneable
Examples
Node node = new Node()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Shape = new BasicShape() { Shape = NodeBasicShapes.Plus, Type = NodeShapes.Basic },
};
Constructors
BasicShape()
Initializes a new instance of the BasicShape.
Declaration
public BasicShape()
BasicShape(BasicShape)
Creates a new instance of the BasicShape from the given BasicShape.
Declaration
public BasicShape(BasicShape src)
Parameters
Type | Name | Description |
---|---|---|
BasicShape | src | BasicShape |
Properties
CornerRadius
Gets or sets the corner radius of the node shape. It is applicable only to a rectangle shape.
Declaration
public double CornerRadius { get; set; }
Property Value
Type |
---|
System.Double |
Examples
Node node = new Node()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Shape = new BasicShape() {CornerRadius = 20, Shape = NodeBasicShapes.Plus, Type = NodeShapes.Basic },
};
Points
Defines the collection of points to draw a polygon. It is applicable only to a polygon shape.
Declaration
public DiagramPoint[] Points { get; set; }
Property Value
Type |
---|
DiagramPoint[] |
Examples
Node node = new Node()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Shape = new BasicShape() {Type=NodeShapes.Basic, Shape=NodeBasicShapes.Polygon,
Points= new DiagramPoint[]{new DiagramPoint() { X=35},new DiagramPoint() { X=65 },new DiagramPoint() { X = 100, Y=35 },
new DiagramPoint() { X = 100, Y = 65 }, new DiagramPoint() { X = 65, Y=100 },
new DiagramPoint() { X = 35, Y=100 },new DiagramPoint() { Y=65 },new DiagramPoint{ Y=35 }
},
};
Shape
Defines the available built-in basic shapes.
Declaration
public NodeBasicShapes Shape { get; set; }
Property Value
Type |
---|
NodeBasicShapes |
Examples
Node node = new Node()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Shape = new BasicShape() { Shape = NodeBasicShapes.Plus, Type = NodeShapes.Basic },
};
Methods
Clone()
Creates a new shape that is a copy of the current basic shape.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | it returns basich shapes |
Overrides
Implements
System.ICloneable