Aspose::Words::Drawing::HorizontalRuleFormat::get_Alignment метод
HorizontalRuleFormat::get_Alignment method
Получает или задает выравнивание горизонтальной линии.
Aspose::Words::Drawing::HorizontalRuleAlignment Aspose::Words::Drawing::HorizontalRuleFormat::get_Alignment()
Примечания
Значение по умолчанию — Left.
Примеры
Показывает, как вставить форму горизонтального правила и настроить её форматирование.
auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);
System::SharedPtr<Aspose::Words::Drawing::Shape> shape = builder->InsertHorizontalRule();
System::SharedPtr<Aspose::Words::Drawing::HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(Aspose::Words::Drawing::HorizontalRuleAlignment::Center);
horizontalRuleFormat->set_WidthPercent(70);
horizontalRuleFormat->set_Height(3);
horizontalRuleFormat->set_Color(System::Drawing::Color::get_Blue());
horizontalRuleFormat->set_NoShade(true);
ASSERT_TRUE(shape->get_IsHorizontalRule());
ASSERT_TRUE(shape->get_HorizontalRuleFormat()->get_NoShade());
См. также
- Enum HorizontalRuleAlignment
- Class HorizontalRuleFormat
- Namespace Aspose::Words::Drawing
- Library Aspose.Words for C++