Aspose::Words::Drawing::VerticalAlignment enum

VerticalAlignment enum

Specifies vertical alignment of a floating shape, text frame or a floating table.

enum class VerticalAlignment

Values

NameValueDescription
None0The object is explicitly positioned, usually using its Top property.
Top1Specifies that the object shall be at the top of the vertical alignment base.
Center2Specifies that the object shall be centered with respect to the vertical alignment base.
Bottom3Specifies that the object shall be at the bottom of the vertical alignment base.
Inside4Specifies that the object shall be inside of the horizontal alignment base.
Outside5Specifies that the object shall be outside of the vertical alignment base.
Inline-1Not documented. Seems to be a possible value for floating paragraphs and tables.
Defaultn/aSame as None.

Examples

Shows how to insert a floating image to the center of a page.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
SharedPtr<Shape> shape = builder->InsertImage(ImageDir + u"Logo.jpg");
shape->set_WrapType(WrapType::None);
shape->set_BehindText(true);
shape->set_RelativeHorizontalPosition(RelativeHorizontalPosition::Page);
shape->set_RelativeVerticalPosition(RelativeVerticalPosition::Page);
shape->set_HorizontalAlignment(HorizontalAlignment::Center);
shape->set_VerticalAlignment(VerticalAlignment::Center);

doc->Save(ArtifactsDir + u"Image.CreateFloatingPageCenter.docx");

See Also