HorizontalAlignment Enumeration |
Specifies horizontal alignment of a floating shape, text frame or floating table.
Namespace:
Aspose.Words.Drawing
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntaxpublic enum HorizontalAlignment
Public Enumeration HorizontalAlignment
public enum class HorizontalAlignment
Members|
| Member name | Value | Description |
|---|
| None | 0 |
The object is explicitly positioned, usually using its Left property.
|
| Default | 0 |
Same as None.
|
| Left | 1 |
Specifies that the object shall be left aligned to the horizontal alignment base.
|
| Center | 2 |
Specifies that the object shall be centered with respect to the horizontal alignment base.
|
| Right | 3 |
Specifies that the object shall be right aligned to the horizontal alignment base.
|
| Inside | 4 |
Specifies that the object shall be inside of the horizontal alignment base.
|
| Outside | 5 |
Specifies that the object shall be outside of the horizontal alignment base.
|
Remarks
ExamplesShows how to insert a floating image in the middle of a page.
DocumentBuilder builder = new DocumentBuilder();
Shape shape = builder.InsertImage(ImageDir + "Logo.jpg");
shape.WrapType = WrapType.None;
shape.BehindText = true;
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
shape.HorizontalAlignment = HorizontalAlignment.Center;
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page;
shape.VerticalAlignment = VerticalAlignment.Center;
builder.Document.Save(ArtifactsDir + "Image.CreateFloatingPageCenter.doc");
See Also