alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class RadialGradientBrush

    Represents the focal point that defines the beginning of the gradient and a circle that defines the endpoint of the gradient.

    Inheritance
    object
    DiagramObject
    GradientBrush
    RadialGradientBrush
    Implements
    IDiagramObject
    ICloneable
    Inherited Members
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(string, object, object, IDiagramObject)
    GradientBrush.GradientStops
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    [JsonPropertyName("cx")]
    public double CX { get; set; }
    Property Value
    Type Description
    double

    A double indicating the x-coordinate. Default is 0.0.

    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
    [JsonPropertyName("cy")]
    public double CY { get; set; }
    Property Value
    Type Description
    double

    A double indicating the y-coordinate. Default is 0.0.

    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
    [JsonPropertyName("fx")]
    public double FX { get; set; }
    Property Value
    Type Description
    double

    A double indicating the x-coordinate. Default is 0.0.

    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
    [JsonPropertyName("fy")]
    public double FY { get; set; }
    Property Value
    Type Description
    double

    A double indicating the y-coordinate. Default is 0.0.

    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
    [JsonPropertyName("r")]
    public double R { get; set; }
    Property Value
    Type Description
    double

    A double representing the radius. Default is 50.0.

    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
    object

    A new RadialGradientBrush instance.

    Overrides
    DiagramObject.Clone()

    Implements

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