ShapeBaseRotation Property |
Namespace: Aspose.Words.Drawing
The default value is 0.
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");