Aspose::Words::Drawing::TextureAlignment enum

TextureAlignment enum

Specifies the alignment for the tiling of the texture fill.

enum class TextureAlignment : int

Values

NameValueDescription
Bottom7Bottom texture alignment.
BottomLeft6Bottom left texture alignment.
BottomRight8Bottom right texture alignment.
Center4Center texture alignment.
Left3Left texture alignment.
None9None texture alignment.
Right5Right texture alignment.
Top1Top texture alignment.
TopLeft0Top left texture alignment.
TopRight2Top right texture alignment.

Examples

Shows how to fill and tiling the texture inside the shape.

auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);

System::SharedPtr<Aspose::Words::Drawing::Shape> shape = builder->InsertShape(ShapeType::Rectangle, static_cast<double>(80), static_cast<double>(80));

// Apply texture alignment to the shape fill.
shape->get_Fill()->PresetTextured(PresetTexture::Canvas);
shape->get_Fill()->set_TextureAlignment(TextureAlignment::TopRight);

// Use the compliance option to define the shape using DML if you want to get "TextureAlignment"
// property after the document saves.
auto saveOptions = System::MakeObject<Aspose::Words::Saving::OoxmlSaveOptions>();
saveOptions->set_Compliance(OoxmlCompliance::Iso29500_2008_Strict);

doc->Save(get_ArtifactsDir() + u"Shape.TextureFill.docx", saveOptions);

doc = System::MakeObject<Aspose::Words::Document>(System::String(get_ArtifactsDir() + u"Shape.TextureFill.docx"));
shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(NodeType::Shape, 0, true));

ASSERT_EQ(shape->get_Fill()->get_TextureAlignment(), TextureAlignment::TopRight);
ASSERT_EQ(shape->get_Fill()->get_PresetTexture(), PresetTexture::Canvas);

See Also