GradientFill Class

Defines the GradientFill Class.When the object is serialized out as xml, its qualified name is a:gradFill.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Drawing.GradientFill

Namespace:  DocumentFormat.OpenXml.Drawing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(TileRectangle))> _
<ChildElementInfoAttribute(GetType(LinearGradientFill))> _
<ChildElementInfoAttribute(GetType(PathGradientFill))> _
<ChildElementInfoAttribute(GetType(GradientStopList))> _
Public Class GradientFill _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As GradientFill
[ChildElementInfoAttribute(typeof(TileRectangle))]
[ChildElementInfoAttribute(typeof(LinearGradientFill))]
[ChildElementInfoAttribute(typeof(PathGradientFill))]
[ChildElementInfoAttribute(typeof(GradientStopList))]
public class GradientFill : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • GradientStopList <a:gsLst>

  • LinearGradientFill <a:lin>

  • PathGradientFill <a:path>

  • TileRectangle <a:tileRect>

[ISO/IEC 29500-1 1st Edition]

20.1.8.33 gradFill (Gradient Fill)

This element defines a gradient fill.

A gradient fill is a fill which is characterized by a smooth gradual transition from one color to the next. At its simplest, it is a fill which transitions between two colors; or more generally, it can be a transition of any number of colors.

The desired transition colors and locations are defined in the gradient stop list (gsLst) child element.

The other child element defines the properties of the gradient fill (there are two styles-- a linear shade style as well as a path shade style)

[Example:

The following is a sample gradient fill, varying from blue to white:

end example]

Parent Elements

bg (§21.4.3.1); bgFillStyleLst (§20.1.4.1.7); bgPr (§19.3.1.2); defRPr (§21.1.2.3.2); endParaRPr (§21.1.2.2.3); fill (§20.1.8.28); fill (§20.1.4.2.9); fillOverlay (§20.1.8.29); fillStyleLst (§20.1.4.1.13); grpSpPr (§21.3.2.14); grpSpPr (§20.1.2.2.22); grpSpPr (§20.5.2.18); grpSpPr (§19.3.1.23); ln (§20.1.2.2.24); lnB (§21.1.3.5); lnBlToTr (§21.1.3.6); lnL (§21.1.3.7); lnR (§21.1.3.8); lnT (§21.1.3.9); lnTlToBr (§21.1.3.10); rPr (§21.1.2.3.9); spPr (§21.2.2.197); spPr (§21.3.2.23); spPr (§21.4.3.7); spPr (§20.1.2.2.35); spPr (§20.2.2.6); spPr (§20.5.2.30); spPr (§19.3.1.44); tblPr (§21.1.3.15); tcPr (§21.1.3.17); uFill (§21.1.2.3.12); uLn (§21.1.2.3.14)

Child Elements

Subclause

gsLst (Gradient Stop List)

§20.1.8.37

lin (Linear Gradient Fill)

§20.1.8.41

path (Path Gradient)

§20.1.8.46

tileRect (Tile Rectangle)

§20.1.8.59

Attributes

Description

flip (Tile Flip)

Specifies the direction(s) in which to flip the gradient while tiling.

Normally a gradient fill encompasses the entire bounding box of the shape which contains the fill. However, with the tileRect element, 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.

The possible values for this attribute are defined by the ST_TileFlipMode simple type (§20.1.10.86).

rotWithShape (Rotate With Shape)

Specifies if a fill rotates along with a shape when the shape is rotated.

[Example:

The following is a fill with the flip attribute set to "x". The black interior rectangle indicates the tile rectangle. Notice that the adjacent rectangle to the right in the tile has been flipped along the x-axis.

DocumentFormat.OpenXml.Drawing.GradientFill-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_GradientFillProperties) is located in §A.4.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

GradientFill Members

DocumentFormat.OpenXml.Drawing Namespace