ShapeBaseRotation Property

Defines the angle (in degrees) that a shape is rotated. Positive value corresponds to clockwise rotation angle.

Namespace:  Aspose.Words.Drawing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public double Rotation { get; set; }

Property Value

Type: Double
Remarks

The default value is 0.

Examples
Shows how to insert shapes.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a cube and set its name
Shape shape = builder.InsertShape(ShapeType.Cube, 150, 150);
shape.Name = "MyCube";

// We can also set the alt text like this
// This text will be found in Format AutoShape > Alt Text
shape.AlternativeText = "Alt text for MyCube.";

// Insert a text box
shape = builder.InsertShape(ShapeType.TextBox, 300, 50);
shape.Font.Name = "Times New Roman";

// Move the builder into the text box and write text
builder.MoveTo(shape.LastParagraph);
builder.Write("Hello world!");

// Move the builder out of the text box back into the main document
builder.MoveTo(shape.ParentParagraph);         

// Insert a shape with an image
shape = builder.InsertImage(Image.FromFile(ImageDir + "Logo.jpg"));
Assert.True(shape.CanHaveImage);
Assert.True(shape.HasImage);

// Rotate the image
shape.Rotation = 45.0;

doc.Save(ArtifactsDir + "Shape.Insert.docx");
See Also