Aspose::Words::Drawing::HorizontalRuleFormat Class Reference

Detailed Description

Represents horizontal rule formatting.

Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
SharedPtr<Shape> shape = builder->InsertHorizontalRule();
SharedPtr<HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(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());

#include <Aspose.Words.Cpp/Drawing/HorizontalRuleFormat.h>

+ Inheritance diagram for Aspose::Words::Drawing::HorizontalRuleFormat:

Public Member Functions

HorizontalRuleAlignment get_Alignment ()
 Gets or sets the alignment of the horizontal rule. More...
 
Color get_Color ()
 Gets or sets the brush color that fills the horizontal rule. More...
 
double get_Height ()
 Gets or sets the height of the horizontal rule. More...
 
bool get_NoShade ()
 Indicates the presence of 3D shading for the horizontal rule. If true, then the horizontal rule is without 3D shading and solid color is used. More...
 
double get_WidthPercent ()
 Gets or sets the length of the specified horizontal rule expressed as a percentage of the window width. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_Alignment (HorizontalRuleAlignment value)
 Setter for get_Alignment. More...
 
void set_Color (Color value)
 Setter for get_Color. More...
 
void set_Height (double value)
 Setter for get_Height. More...
 
void set_NoShade (bool value)
 Setter for get_NoShade. More...
 
void set_WidthPercent (double value)
 Setter for get_WidthPercent. More...
 

Static Public Member Functions

static const TypeInfoType ()
 

Member Function Documentation

◆ get_Alignment()

Aspose::Words::Drawing::HorizontalRuleAlignment Aspose::Words::Drawing::HorizontalRuleFormat::get_Alignment ( )

Gets or sets the alignment of the horizontal rule.

The default value is Left.

Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
SharedPtr<Shape> shape = builder->InsertHorizontalRule();
SharedPtr<HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(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());

◆ get_Color()

System::Drawing::Color Aspose::Words::Drawing::HorizontalRuleFormat::get_Color ( )

Gets or sets the brush color that fills the horizontal rule.

This is a shortcut to the Color property.

The default value is Gray.

Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
SharedPtr<Shape> shape = builder->InsertHorizontalRule();
SharedPtr<HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(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());

◆ get_Height()

double Aspose::Words::Drawing::HorizontalRuleFormat::get_Height ( )

Gets or sets the height of the horizontal rule.

This is a shortcut to the Height property.

Valid values ​​range from 0 to 1584 inclusive.

The default value is 1.5.

Exceptions
System::ArgumentOutOfRangeExceptionThrows when argument was out of the range of valid values.
Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
SharedPtr<Shape> shape = builder->InsertHorizontalRule();
SharedPtr<HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(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());

◆ get_NoShade()

bool Aspose::Words::Drawing::HorizontalRuleFormat::get_NoShade ( )

Indicates the presence of 3D shading for the horizontal rule. If true, then the horizontal rule is without 3D shading and solid color is used.

The default value is false.

Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
SharedPtr<Shape> shape = builder->InsertHorizontalRule();
SharedPtr<HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(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());

◆ get_WidthPercent()

double Aspose::Words::Drawing::HorizontalRuleFormat::get_WidthPercent ( )

Gets or sets the length of the specified horizontal rule expressed as a percentage of the window width.

Valid values ​​range from 1 to 100 inclusive.

The default value is 100.

Exceptions
System::ArgumentOutOfRangeExceptionThrows when argument was out of the range of valid values.
Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
SharedPtr<Shape> shape = builder->InsertHorizontalRule();
SharedPtr<HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(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());

◆ GetType()

virtual const System::TypeInfo & Aspose::Words::Drawing::HorizontalRuleFormat::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::Drawing::HorizontalRuleFormat::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ set_Alignment()

void Aspose::Words::Drawing::HorizontalRuleFormat::set_Alignment ( Aspose::Words::Drawing::HorizontalRuleAlignment  value)

◆ set_Color()

void Aspose::Words::Drawing::HorizontalRuleFormat::set_Color ( System::Drawing::Color  value)

◆ set_Height()

void Aspose::Words::Drawing::HorizontalRuleFormat::set_Height ( double  value)

◆ set_NoShade()

void Aspose::Words::Drawing::HorizontalRuleFormat::set_NoShade ( bool  value)

◆ set_WidthPercent()

void Aspose::Words::Drawing::HorizontalRuleFormat::set_WidthPercent ( double  value)

◆ Type()

static const System::TypeInfo & Aspose::Words::Drawing::HorizontalRuleFormat::Type ( )
static