GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricing

    Show / Hide Table of Contents

    GradientBrush Class

    Namespace:
    GemBox.Document.Drawing
    Assembly:
    GemBox.Document.dll

    Represents a brush with a smooth gradual transition of colors at the specified locations that either follows a line or a path.

    • C#
    • VB.NET
    public sealed class GradientBrush : Brush
    Public NotInheritable Class GradientBrush
        Inherits Brush
    Inheritance:
    System.Object
    Brush
    GradientBrush

    Properties

    Angle

    Specifies the direction of color change for the gradient.

    • C#
    • VB.NET
    public double Angle { get; set; }
    Public Property Angle As Double
    Property Value
    System.Double

    The direction of the color change for the gradient, expressed as a value between 0 and 1.

    Remarks

    This property is applicable only when GradientType is Linear.

    FillRectangle

    Gets or sets the rectangle defining the paint area for the gradient.

    • C#
    • VB.NET
    public RelativeRectangle FillRectangle { get; set; }
    Public Property FillRectangle As RelativeRectangle
    Property Value
    RelativeRectangle

    A RelativeRectangle that defines the paint area.

    Remarks

    This property is not applicable when GradientType is Linear.

    GradientType

    Gets or sets the type of the gradient brush.

    • C#
    • VB.NET
    public GradientBrushType GradientType { get; set; }
    Public Property GradientType As GradientBrushType
    Property Value
    GradientBrushType

    The type of the gradient brush.

    Remarks

    Currently, only Linear and Radial types are supported when saving to PDF, XPS, or image formats.

    RotateWithShape

    Gets or sets a value indicating whether the gradient brush should rotate with the shape.

    • C#
    • VB.NET
    public bool RotateWithShape { get; set; }
    Public Property RotateWithShape As Boolean
    Property Value
    System.Boolean

    true if the gradient brush should rotate with the shape; otherwise, false.

    Remarks

    If set to true and a shape that has been brushed with a gradient is transformed with a rotation, then the gradient brush will be transformed with the same rotation.

    Scaled

    Specifies whether the gradient angle scales with the region.

    • C#
    • VB.NET
    public bool Scaled { get; set; }
    Public Property Scaled As Boolean
    Property Value
    System.Boolean

    true if the gradient angle scales with the region, false otherwise.

    Remarks

    This property is applicable only when GradientType is Linear.

    Stops

    Gets the collection of gradient stops in this brush format.

    • C#
    • VB.NET
    public GradientStopCollection Stops { get; }
    Public ReadOnly Property Stops As GradientStopCollection
    Property Value
    GradientStopCollection

    The collection of gradient stops in this brush format

    TileRectangle

    Gets or sets the rectangle defining the tile area for repeating gradient patterns.

    • C#
    • VB.NET
    public RelativeRectangle TileRectangle { get; set; }
    Public Property TileRectangle As RelativeRectangle
    Property Value
    RelativeRectangle

    A RelativeRectangle that defines the tile area.

    Remarks

    This property is not applicable when GradientType is Linear.

    Inherited Properties

    IsEmpty

    Gets a value indicating whether the parent element is painted.

    (Inherited from Brush)

    Inherited Methods

    SetDefault()

    Sets a default brush on the parent element (element will be painted based on the default settings).

    (Inherited from Brush)

    SetEmpty()

    Sets an empty brush on the parent element (element won't be painted).

    (Inherited from Brush)

    SetGradient(GradientBrushType)

    Sets a gradient brush on the parent element.

    (Inherited from Brush)

    SetPattern(PatternBrushType, Color, Color)

    Sets a pattern brush on the parent element.

    (Inherited from Brush)

    SetPicture(Content)

    Sets a picture brush on the parent element.

    This method is not applicable on Fill property.

    (Inherited from Brush)

    SetPicture(System.IO.Stream)

    Sets a picture brush on the parent element.

    This method is not applicable on Fill property.

    (Inherited from Brush)

    SetPicture(System.IO.Stream, PictureContentType)

    Sets a picture brush on the parent element.

    This method is not applicable on Fill property.

    (Inherited from Brush)

    SetPicture(System.IO.Stream, System.String)

    Sets a picture brush on the parent element.

    This method is not applicable on Fill property.

    (Inherited from Brush)

    SetPicture(System.String, System.Boolean)

    Sets a picture brush on the parent element.

    This method is not applicable on Fill property.

    (Inherited from Brush)

    SetPicture(System.String, PictureContentType)

    Sets a picture brush on the parent element.

    This method is not applicable on Fill property.

    (Inherited from Brush)

    SetPicture(System.String, System.String)

    Sets a picture brush on the parent element.

    This method is not applicable on Fill property.

    (Inherited from Brush)

    SetSolid(Color)

    Sets a solid color brush on the parent element.

    (Inherited from Brush)

    SetSolid(Color, System.Byte)

    Sets a solid color brush on the parent element.

    (Inherited from Brush)

    ToString()

    Returns a System.String that represents this Brush instance.

    (Inherited from Brush)

    Examples

    Shapes Example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.