patterned method
Contents
[
Hide
]patterned(pattern_type)
Sets the specified fill to a pattern.
def patterned(self, pattern_type: aspose.words.drawing.PatternType):
...
Parameter | Type | Description |
---|---|---|
pattern_type | PatternType | PatternType |
patterned(pattern_type, fore_color, back_color)
Sets the specified fill to a pattern.
def patterned(self, pattern_type: aspose.words.drawing.PatternType, fore_color: aspose.pydrawing.Color, back_color: aspose.pydrawing.Color):
...
Parameter | Type | Description |
---|---|---|
pattern_type | PatternType | PatternType |
fore_color | aspose.pydrawing.Color | The color of the foreground fill. |
back_color | aspose.pydrawing.Color | The color of the background fill. |
Examples
Shows how to set pattern for a shape.
doc = aw.Document(MY_DIR + "Shape stroke pattern border.docx")
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
fill = shape.fill
print("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.DIAGONAL_BRICK)
# 2 - Apply pattern with foreground and background colors to the shape fill:
fill.patterned(aw.drawing.PatternType.DIAGONAL_BRICK, drawing.Color.aqua, drawing.Color.bisque)
doc.save(ARTIFACTS_DIR + "Shape.fill_pattern.docx")
See Also
- module aspose.words.drawing
- class Fill