[]
Represents a gradient fill.
public class GradientFill : FormattingBag
Gets or sets the direction of color change for the gradient in degrees 0..360.
To define this angle, let its value be x measured clockwise.
Then ( -sin x, cos x ) is a vector parallel to the line of constant color in the gradient fill.
This property has effect only when the Type property is Linear.
public float Angle { get; set; }
Gets or sets whether the gradient angle scales with the fill region.
Mathematically, if this flag is true, then the gradient vector ( cos x , sin x ) is scaled by the width (w) and height (h) of the fill region, so that the vector becomes ( w cos x, h sin x ) (before normalization).
Observe that now if the gradient angle is 45 degrees, the gradient vector is ( w, h ), which goes from top-left to bottom-right of the fill region. If this flag is false, the gradient angle is independent of the fill region and is not scaled using the manipulation described above.
So a 45-degree gradient angle always give a gradient band whose line of constant color is parallel to the vector (1, -1).
This property has effect only when the Type property is Linear.
public bool AngleScaled { get; set; }
Gets the "focus" rectangle for the center shade, specified relative to the fill tile rectangle.
The center shade fills the entire tile except the margins specified by each property.
Each edge of the center shade rectangle is defined by a percentage offset from the corresponding edge of the tile rectangle.
A positive percentage specifies an inset, while a negative percentage specifies an outset.
public EdgeExtent FillRectangle { get; }
A left offset of 25% specifies that the left edge of the center shade rectangle is located to the right of the tile rectangle's left edge by an amount equal to 25% of the tile rectangle's width.
Gets or sets whether the fill rotates along with the object when the object is rotated.
public bool RotateWithObject { get; set; }
Gets the list of gradient stops that specify the gradient colors and their relative positions in the color band.
public GradientStopList Stops { get; }
Gets or sets the direction(s) in which to flip the gradient while tiling.
Normally a gradient fill encompasses the entire bounding box of the object which contains the fill.
However, with the TileRectangle property, it is possible to define a "tile" rectangle which is smaller than the bounding box.
In this situation, the gradient fill is encompassed within the tile rectangle, and the tile rectangle is tiled across the bounding box to fill the entire area.
This property has effect if the Type property is Rectangle or Circle.
public TileFlipMode TileFlip { get; set; }
Gets a rectangular region of the object to which the gradient is applied.
This region is then tiled across the remaining area of the object to complete the fill.
The tile rectangle is defined by percentage offsets from the sides of the shape's bounding box.
Each edge of the tile rectangle is defined by a percentage offset from the corresponding edge of the bounding box.
A positive percentage specifies an inset, while a negative percentage specifies an outset.
This property has effect if the Type property is Rectangle or Circle.
public EdgeExtent TileRectangle { get; }
A left offset of 25% specifies that the left edge of the tile rectangle is located to the right of the bounding box's left edge by an amount equal to 25% of the bounding box's width.
Gets or sets the gradient fill type.
public GradientType Type { get; set; }
Applies a predefined circle gradient fill direction.
public void ApplyCircleDirection(GradientPathDirection direction)
direction
GradientPathDirectionThe gradient fill direction to apply.
Applies a predefined linear gradient fill direction.
public void ApplyLinearDirection(GradientLinearDirection direction)
direction
GradientLinearDirectionThe linear gradient fill direction to apply.
Applies a preset gradient.
public void ApplyPreset(GradientPreset preset, ThemeColorId themeColor)
preset
GradientPresetThe GradientPreset to apply.
themeColor
ThemeColorIdThe ThemeColorId to apply.
Applies the predefined rectangle gradient fill direction.
public void ApplyRectangleDirection(GradientPathDirection direction)
direction
GradientPathDirectionThe gradient fill direction to apply.
public override bool Equals(object fmt)
fmt
objectFixes all inherited values as "direct" values for this instance.
protected override void FixInheritedValues()
public override int GetHashCode()