RadialGradientPaint Class

A radial gradient, in the coordinates of the shape it paints: the color of offset 0 is at the focal point, and the color of offset 1 on the circle of RadialGradientPaint.CenterX, RadialGradientPaint.CenterY and RadialGradientPaint.Radius. Outside the circle, the gradient spreads as SceneGradientPaint.Spread says.

public sealed class RadialGradientPaint : SceneGradientPaint
Inheritance
SceneGradientPaint RadialGradientPaint

Constructors

NameDescription
RadialGradientPaint(double, double, double, IEnumerable<SceneGradientStop>)Initializes a new instance of the RadialGradientPaint class whose focal point is the center of the circle.
RadialGradientPaint(double, double, double, double, double, IEnumerable<SceneGradientStop>)Initializes a new instance of the RadialGradientPaint class.

RadialGradientPaint overloads

RadialGradientPaint(double, double, double, IEnumerable<SceneGradientStop>)

RadialGradientPaint.cs

Initializes a new instance of the RadialGradientPaint class whose focal point is the center of the circle.

public RadialGradientPaint(double centerX, double centerY, double radius, IEnumerable<SceneGradientStop> stops)
Parameters
centerX double
The x coordinate of the center of the circle.
centerY double
The y coordinate of the center of the circle.
radius double
The radius of the circle.
stops IEnumerable<SceneGradientStop>
The color stops, by increasing offset.

RadialGradientPaint(double, double, double, double, double, IEnumerable<SceneGradientStop>)

RadialGradientPaint.cs

Initializes a new instance of the RadialGradientPaint class.

public RadialGradientPaint(double centerX, double centerY, double radius, double focalX, double focalY, IEnumerable<SceneGradientStop> stops)
Parameters
centerX double
The x coordinate of the center of the circle.
centerY double
The y coordinate of the center of the circle.
radius double
The radius of the circle.
focalX double
The x coordinate of the focal point, the position of offset 0.
focalY double
The y coordinate of the focal point, the position of offset 0.
stops IEnumerable<SceneGradientStop>
The color stops, by increasing offset.

Properties

NameDescription
CenterXGets the x coordinate of the center of the circle of offset 1.
CenterYGets the y coordinate of the center of the circle of offset 1.
FocalRadiusGets the radius of the circle of offset 0 around the focal point, as the SVG 2 fr attribute. The default is 0: offset 0 is the focal point itself.
FocalXGets the x coordinate of the focal point, the position of offset 0.
FocalYGets the y coordinate of the focal point, the position of offset 0.
RadiusGets the radius of the circle of offset 1.

Gets the x coordinate of the center of the circle of offset 1.

public double CenterX { get; }

Property value

double

Gets the y coordinate of the center of the circle of offset 1.

public double CenterY { get; }

Property value

double

Gets the radius of the circle of offset 0 around the focal point, as the SVG 2 fr attribute. The default is 0: offset 0 is the focal point itself.

public double FocalRadius { get; init; }

Property value

double

Remarks

The circle of an offset t is centered t of the way from the focal point to the center, and its radius goes from RadialGradientPaint.FocalRadius to RadialGradientPaint.Radius. Inside the circle of the focal point, the gradient has the color of its first stop when it is padded. A value that is negative or not finite is 0.

Gets the x coordinate of the focal point, the position of offset 0.

public double FocalX { get; }

Property value

double

Gets the y coordinate of the focal point, the position of offset 0.

public double FocalY { get; }

Property value

double

Gets the radius of the circle of offset 1.

public double Radius { get; }

Property value

double