Blazor

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GradientBrush

    Show / Hide Table of Contents

    Class GradientBrush

    Defines a smooth transition from one color to the next while painting the node.

    Inheritance
    System.Object
    DiagramObject
    GradientBrush
    LinearGradientBrush
    RadialGradientBrush
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    DiagramObject.GetParent()
    DiagramObject.Clone()
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public abstract class GradientBrush : DiagramObject, IDiagramObject, ICloneable

    Constructors

    GradientBrush()

    Initializes a new instance of the Gradient.

    Declaration
    protected GradientBrush()

    GradientBrush(GradientBrush)

    Creates a new instance of the GradientBrush from the given Gradient.

    Declaration
    protected GradientBrush(GradientBrush src)
    Parameters
    Type Name Description
    GradientBrush src

    Gradient.

    Properties

    GradientStops

    Gets or sets the color and the position where the previous color transition ends, and a new color transition starts.

    Declaration
    public DiagramObjectCollection<GradientStop> GradientStops { get; set; }
    Property Value
    Type Description
    DiagramObjectCollection<GradientStop>
    Examples
    Node Node = new Node()
    {
        Style = new ShapeStyle()
        {
           Gradient = new LinearGradientBrush()
           {
               //Start point of linear gradient
               X1 = 0,
               Y1 = 0,
               //End point of linear gradient
               X2 = 50,
               Y2 = 50,
               //Sets an array of stop objects
               GradientStops = new DiagramObjectCollection<GradientStop>()
               {
                   new GradientStop(){ Color = "white", Offset = 0},
                   new GradientStop(){ Color = "#6BA5D7", Offset = 100}
               },
           }
        },
     };

    Implements

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