Aspose::Words::Drawing::Fill::Patterned method
Contents
[
Hide
]Fill::Patterned(Aspose::Words::Drawing::PatternType) method
Sets the specified fill to a pattern.
void Aspose::Words::Drawing::Fill::Patterned(Aspose::Words::Drawing::PatternType patternType)
Parameter | Type | Description |
---|---|---|
patternType | Aspose::Words::Drawing::PatternType | PatternType |
Examples
Shows how to set pattern for a shape.
auto doc = MakeObject<Document>(MyDir + u"Shape stroke pattern border.docx");
auto shape = System::ExplicitCast<Shape>(doc->GetChild(NodeType::Shape, 0, true));
SharedPtr<Fill> fill = shape->get_Fill();
std::cout << String::Format(u"Pattern value is: {0}", fill->get_Pattern()) << std::endl;
// There are several ways specified fill to a pattern.
// 1 - Apply pattern to the shape fill:
fill->Patterned(PatternType::DiagonalBrick);
// 2 - Apply pattern with foreground and background colors to the shape fill:
fill->Patterned(PatternType::DiagonalBrick, System::Drawing::Color::get_Aqua(), System::Drawing::Color::get_Bisque());
doc->Save(ArtifactsDir + u"Shape.FillPattern.docx");
See Also
- Enum PatternType
- Class Fill
- Namespace Aspose::Words::Drawing
- Library Aspose.Words for C++
Fill::Patterned(Aspose::Words::Drawing::PatternType, System::Drawing::Color, System::Drawing::Color) method
Sets the specified fill to a pattern.
void Aspose::Words::Drawing::Fill::Patterned(Aspose::Words::Drawing::PatternType patternType, System::Drawing::Color foreColor, System::Drawing::Color backColor)
Parameter | Type | Description |
---|---|---|
patternType | Aspose::Words::Drawing::PatternType | PatternType |
foreColor | System::Drawing::Color | The color of the foreground fill. |
backColor | System::Drawing::Color | The color of the background fill. |
Examples
Shows how to set pattern for a shape.
auto doc = MakeObject<Document>(MyDir + u"Shape stroke pattern border.docx");
auto shape = System::ExplicitCast<Shape>(doc->GetChild(NodeType::Shape, 0, true));
SharedPtr<Fill> fill = shape->get_Fill();
std::cout << String::Format(u"Pattern value is: {0}", fill->get_Pattern()) << std::endl;
// There are several ways specified fill to a pattern.
// 1 - Apply pattern to the shape fill:
fill->Patterned(PatternType::DiagonalBrick);
// 2 - Apply pattern with foreground and background colors to the shape fill:
fill->Patterned(PatternType::DiagonalBrick, System::Drawing::Color::get_Aqua(), System::Drawing::Color::get_Bisque());
doc->Save(ArtifactsDir + u"Shape.FillPattern.docx");
See Also
- Enum PatternType
- Class Fill
- Namespace Aspose::Words::Drawing
- Library Aspose.Words for C++