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
SceneGradientPaintRadialGradientPaint
Constructors
| Name | Description |
|---|---|
| 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.csInitializes 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
centerXdouble- The x coordinate of the center of the circle.
centerYdouble- The y coordinate of the center of the circle.
radiusdouble- The radius of the circle.
stopsIEnumerable<SceneGradientStop>- The color stops, by increasing offset.
RadialGradientPaint(double, double, double, double, double, IEnumerable<SceneGradientStop>)
RadialGradientPaint.csInitializes a new instance of the RadialGradientPaint class.
public RadialGradientPaint(double centerX, double centerY, double radius, double focalX, double focalY, IEnumerable<SceneGradientStop> stops)Parameters
centerXdouble- The x coordinate of the center of the circle.
centerYdouble- The y coordinate of the center of the circle.
radiusdouble- The radius of the circle.
focalXdouble- The x coordinate of the focal point, the position of offset 0.
focalYdouble- The y coordinate of the focal point, the position of offset 0.
stopsIEnumerable<SceneGradientStop>- The color stops, by increasing offset.
Properties
| Name | Description |
|---|---|
| CenterX | Gets the x coordinate of the center of the circle of offset 1. |
| CenterY | Gets the y coordinate of the center of the circle of offset 1. |
| FocalRadius | 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. |
| FocalX | Gets the x coordinate of the focal point, the position of offset 0. |
| FocalY | Gets the y coordinate of the focal point, the position of offset 0. |
| Radius | Gets the radius of the circle of offset 1. |
CenterX
RadialGradientPaint.csCenterY
RadialGradientPaint.csFocalRadius
RadialGradientPaint.csGets 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
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.