Class RadialGradientBrush
Represents the focal point that defines the beginning of the gradient and a circle that defines the endpoint of the gradient.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class RadialGradientBrush : GradientBrush, IDiagramObject, ICloneable
Remarks
The RadialGradientBrush provides a circular gradient fill, commonly used in graphical applications to create realistic lighting effects.
Use the properties FX, FY, CX, CY, and R to adjust the radial gradient appearance.
Examples
Node Node = new Node()
{
OffsetX = 250,
OffsetY = 250,
Width = 100,
Height = 100,
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
FX = 20,
FY = 20,
CX = 50,
CY = 50,
R = 50,
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0 },
new GradientStop(){ Color = "#6BA5D7", Offset = 100 }
},
}
},
};
Constructors
RadialGradientBrush()
Creates a new instance of the RadialGradientBrush from the given RadialGradient.
Declaration
public RadialGradientBrush()
RadialGradientBrush(RadialGradientBrush)
Initializes a new instance of the RadialGradientBrush class.
Declaration
public RadialGradientBrush(RadialGradientBrush src)
Parameters
Type | Name | Description |
---|---|---|
RadialGradientBrush | src | The source RadialGradientBrush to copy from. |
Properties
CX
Gets or sets the x-coordinate for the center point of the outer circle of the radial gradient.
Declaration
public double CX { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double indicating the x-coordinate. Default is |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0},
new GradientStop(){ Color = "#6BA5D7", Offset = 100}
},
}
},
};
CY
Gets or sets the y-coordinate for the center point of the outer circle of the radial gradient.
Declaration
public double CY { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double indicating the y-coordinate. Default is |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0},
new GradientStop(){ Color = "#6BA5D7", Offset = 100}
},
}
},
};
FX
Gets or sets the x-coordinate for the center point of the inner circle of the radial gradient.
Declaration
public double FX { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double indicating the x-coordinate. Default is |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0},
new GradientStop(){ Color = "#6BA5D7", Offset = 100}
},
}
},
};
FY
Gets or sets the y-coordinate for the center point of the inner circle of the radial gradient.
Declaration
public double FY { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double indicating the y-coordinate. Default is |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0},
new GradientStop(){ Color = "#6BA5D7", Offset = 100}
},
}
},
};
R
Gets or sets the radius of the radial gradient.
Declaration
public double R { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A System.Double representing the radius. Default is |
Examples
Node Node = new Node()
{
Style = new ShapeStyle()
{
Gradient = new RadialGradientBrush()
{
//Center point of the inner circle
FX = 20,
FY = 20,
//Center point of the outer circle
CX = 50,
CY = 50,
//Radius of a radial gradient
R = 50,
//Set an array of stop objects
GradientStops = new DiagramObjectCollection<GradientStop>()
{
new GradientStop(){ Color = "white", Offset = 0},
new GradientStop(){ Color = "#6BA5D7", Offset = 100}
},
}
},
};
Methods
Clone()
Creates a new object that is a copy of the current radial gradient.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new RadialGradientBrush instance. |