[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.GradientFill

Class GradientFill

Namespace
GrapeCity.Documents.Word
Assembly
GcDocs.Word.dll

Represents a gradient fill.

public class GradientFill : FormattingBag
Inheritance
object
GradientFill
Inherited Members
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()

Properties

Angle

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; }

Property Value

float

AngleScaled

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; }

Property Value

bool

FillRectangle

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.

This property has NO effect if the Type property is Linear.

public EdgeExtent FillRectangle { get; }

Property Value

EdgeExtent

Examples

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.

RotateWithObject

Gets or sets whether the fill rotates along with the object when the object is rotated.

public bool RotateWithObject { get; set; }

Property Value

bool

Stops

Gets the list of gradient stops that specify the gradient colors and their relative positions in the color band.

public GradientStopList Stops { get; }

Property Value

GradientStopList

TileFlip

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; }

Property Value

TileFlipMode

TileRectangle

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; }

Property Value

EdgeExtent

Examples

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.

Type

Gets or sets the gradient fill type.

public GradientType Type { get; set; }

Property Value

GradientType

Methods

ApplyCircleDirection(GradientPathDirection)

Applies a predefined circle gradient fill direction.

public void ApplyCircleDirection(GradientPathDirection direction)

Parameters

direction GradientPathDirection

The gradient fill direction to apply.

ApplyLinearDirection(GradientLinearDirection)

Applies a predefined linear gradient fill direction.

public void ApplyLinearDirection(GradientLinearDirection direction)

Parameters

direction GradientLinearDirection

The linear gradient fill direction to apply.

ApplyPreset(GradientPreset, ThemeColorId)

Applies a preset gradient.

public void ApplyPreset(GradientPreset preset, ThemeColorId themeColor)

Parameters

preset GradientPreset

The GradientPreset to apply.

themeColor ThemeColorId

The ThemeColorId to apply.

ApplyRectangleDirection(GradientPathDirection)

Applies the predefined rectangle gradient fill direction.

public void ApplyRectangleDirection(GradientPathDirection direction)

Parameters

direction GradientPathDirection

The gradient fill direction to apply.

Equals(object)

public override bool Equals(object fmt)

Parameters

fmt object

Returns

bool

FixInheritedValues()

Fixes all inherited values as "direct" values for this instance.

protected override void FixInheritedValues()

GetHashCode()

public override int GetHashCode()

Returns

int