PatternType enumeration

PatternType enumeration

Specifies the fill pattern to be used to fill a shape.

Members

NameDescription
NoneNo pattern.
Percent1010% of the foreground color.
Percent2020% of the foreground color.
Percent2525% of the foreground color.
Percent3030% of the foreground color.
Percent4040% of the foreground color
Percent5050% of the foreground color
Percent55% of the foreground color.
Percent6060% of the foreground color.
Percent7070% of the foreground color.
Percent7575% of the foreground color.
Percent8080% of the foreground color.
Percent9090% of the foreground color.
CrossCross.
DarkDownwardDiagonalDark downward diagonal.
DarkHorizontalDark horizontal.
DarkUpwardDiagonalDark upward diagonal.
DarkVerticalDark vertical.
DashedDownwardDiagonalDashed downward diagonal.
DashedHorizontalDashed horizontal.
DashedUpwardDiagonalDashed upward diagonal.
DashedVerticalDashed vertical.
DiagonalBrickDiagonal brick.
DiagonalCrossDiagonal cross.
DivotPattern divot.
DottedDiamondDotted diamond.
DottedGridDotted grid.
DownwardDiagonalDownward diagonal.
HorizontalHorizontal.
HorizontalBrickHorizontal brick.
LargeCheckerBoardLarge checker board.
LargeConfettiLarge confetti.
LargeGridLarge grid.
LightDownwardDiagonalLight downward diagonal.
LightHorizontalLight horizontal.
LightUpwardDiagonalLight upward diagonal.
LightVerticalLight vertical.
NarrowHorizontalNarrow horizontal.
NarrowVerticalNarrow vertical.
OutlinedDiamondOutlined diamond.
PlaidPlaid.
ShingleShingle.
SmallCheckerBoardSmall checker board.
SmallConfettiSmall confetti.
SmallGridSmall grid.
SolidDiamondSolid diamond.
SphereSphere.
TrellisTrellis.
UpwardDiagonalUpward diagonal.
VerticalVertical.
WaveWave.
WeaveWeave.
WideDownwardDiagonalWide downward diagonal.
WideUpwardDiagonalWide upward diagonal.
ZigZagZig zag.

Examples

Shows how to set pattern for a shape.

let doc = new aw.Document(base.myDir + "Shape stroke pattern border.docx");

let shape = doc.getShape(0, true);
let fill = shape.fill;

console.log(`Pattern value is: ${fill.pattern}`);

// There are several ways specified fill to a pattern.
// 1 -  Apply pattern to the shape fill:
fill.patterned(aw.Drawing.PatternType.DiagonalBrick);

// 2 -  Apply pattern with foreground and background colors to the shape fill:
fill.patterned(aw.Drawing.PatternType.DiagonalBrick, "#00FFFF", "#FFE4C4");

doc.save(base.artifactsDir + "Shape.FillPattern.docx");

See Also