GradientBrush GradientBrush GradientBrush Class

Definition

An abstract class that describes a gradient, composed of gradient stops. Parent class for LinearGradientBrush.

public : class GradientBrush : Brush, IGradientBrush
public class GradientBrush : Brush, IGradientBrush
Public Class GradientBrush Inherits Brush Implements IGradientBrush
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You describe the color composition of a LinearGradientBrush using the GradientStops property. Each GradientStop therein expresses a Color and an Offset. Offset values should be between 0 and 1. Color values can be any value expressed as a named color or one of the conversion syntaxes; see notes in GradientStop.Color, particularly the XAML syntax.

GradientBrush derived classes

GradientBrush is the parent class for LinearGradientBrush. The Windows Runtime XAML vocabulary doesn't support RadialGradientBrush.

Constructors

GradientBrush() GradientBrush() GradientBrush()

Provides base class initialization behavior for GradientBrush -derived classes.

protected : GradientBrush()
protected GradientBrush()
Protected Sub New()

Properties

ColorInterpolationMode ColorInterpolationMode ColorInterpolationMode

Gets or sets a ColorInterpolationMode enumeration value that specifies how the gradient's colors are interpolated.

public : ColorInterpolationMode ColorInterpolationMode { get; set; }
public ColorInterpolationMode ColorInterpolationMode { get; set; }
Public ReadWrite Property ColorInterpolationMode As ColorInterpolationMode
<gradientBrush ColorInterpolationMode="colorInterpolationModeMemberName"/>
Value
ColorInterpolationMode ColorInterpolationMode ColorInterpolationMode

Specifies how the colors in a gradient are interpolated. The default is SRgbLinearInterpolation.

ColorInterpolationModeProperty ColorInterpolationModeProperty ColorInterpolationModeProperty

Identifies the ColorInterpolationMode dependency property.

public : static DependencyProperty ColorInterpolationModeProperty { get; }
public static DependencyProperty ColorInterpolationModeProperty { get; }
Public Static ReadOnly Property ColorInterpolationModeProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ColorInterpolationMode dependency property.

Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

GradientStops GradientStops GradientStops

Gets or sets the brush's gradient stops.

public : GradientStopCollection GradientStops { get; set; }
public GradientStopCollection GradientStops { get; set; }
Public ReadWrite Property GradientStops As GradientStopCollection
<gradientBrush>
  oneOrMoreGradientStops
</gradientBrush>
Value
GradientStopCollection GradientStopCollection GradientStopCollection

A collection of the GradientStop objects associated with the brush, each of which specifies a color and an offset along the brush's gradient axis. The default is an empty GradientStopCollection.

GradientStopsProperty GradientStopsProperty GradientStopsProperty

Identifies the GradientStops dependency property.

public : static DependencyProperty GradientStopsProperty { get; }
public static DependencyProperty GradientStopsProperty { get; }
Public Static ReadOnly Property GradientStopsProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the GradientStops dependency property.

MappingMode MappingMode MappingMode

Gets or sets a BrushMappingMode enumeration value that specifies whether the positioning coordinates of the gradient brush are absolute or relative to the output area.

public : BrushMappingMode MappingMode { get; set; }
public BrushMappingMode MappingMode { get; set; }
Public ReadWrite Property MappingMode As BrushMappingMode
<gradientBrush MappingMode="Absolute"/>
-or-
<gradientBrush MappingMode="RelativeToBoundingBox"/>
Value
BrushMappingMode BrushMappingMode BrushMappingMode

A BrushMappingMode value that specifies how to interpret the gradient brush's positioning coordinates. The default is RelativeToBoundingBox.

MappingModeProperty MappingModeProperty MappingModeProperty

Identifies the MappingMode dependency property.

public : static DependencyProperty MappingModeProperty { get; }
public static DependencyProperty MappingModeProperty { get; }
Public Static ReadOnly Property MappingModeProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the MappingMode dependency property.

Opacity Opacity Opacity

Inherited from Brush

OpacityProperty OpacityProperty OpacityProperty

Inherited from Brush

RelativeTransform RelativeTransform RelativeTransform

Inherited from Brush

RelativeTransformProperty RelativeTransformProperty RelativeTransformProperty

Inherited from Brush

SpreadMethod SpreadMethod SpreadMethod

Gets or sets the type of spread method that specifies how to draw a gradient that starts or ends inside the bounds of the object to be painted.

public : GradientSpreadMethod SpreadMethod { get; set; }
public GradientSpreadMethod SpreadMethod { get; set; }
Public ReadWrite Property SpreadMethod As GradientSpreadMethod
<gradientBrush SpreadMethod="Pad"/>
-or-
<gradientBrush SpreadMethod="Reflect"/>
-or-
<gradientBrush SpreadMethod="Repeat"/>
Value
GradientSpreadMethod GradientSpreadMethod GradientSpreadMethod

The type of spread method used to paint the gradient. The default is Pad.

SpreadMethodProperty SpreadMethodProperty SpreadMethodProperty

Identifies the SpreadMethod dependency property.

public : static DependencyProperty SpreadMethodProperty { get; }
public static DependencyProperty SpreadMethodProperty { get; }
Public Static ReadOnly Property SpreadMethodProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the SpreadMethod dependency property.

Transform Transform Transform

Inherited from Brush

TransformProperty TransformProperty TransformProperty

Inherited from Brush

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

See Also