java.lang.Object
com.aspose.words.FlipOrientation
public class FlipOrientation
- extends java.lang.Object
Utility class containing constants.
Possible values for the orientation of a shape.
Example:
Shows how to flip a shape on an axis.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert an image shape and leave its orientation in its default state.
Shape shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 100.0,
RelativeVerticalPosition.TOP_MARGIN, 100.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
Assert.assertEquals(FlipOrientation.NONE, shape.getFlipOrientation());
shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 250.0,
RelativeVerticalPosition.TOP_MARGIN, 100.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
// Set the "FlipOrientation" property to "FlipOrientation.Horizontal" to flip the second shape on the y-axis,
// making it into a horizontal mirror image of the first shape.
shape.setFlipOrientation(FlipOrientation.HORIZONTAL);
shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 100.0,
RelativeVerticalPosition.TOP_MARGIN, 250.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
// Set the "FlipOrientation" property to "FlipOrientation.Horizontal" to flip the third shape on the x-axis,
// making it into a vertical mirror image of the first shape.
shape.setFlipOrientation(FlipOrientation.VERTICAL);
shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 250.0,
RelativeVerticalPosition.TOP_MARGIN, 250.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
// Set the "FlipOrientation" property to "FlipOrientation.Horizontal" to flip the fourth shape on both the x and y axes,
// making it into a horizontal and vertical mirror image of the first shape.
shape.setFlipOrientation(FlipOrientation.BOTH);
doc.save(getArtifactsDir() + "Shape.FlipShapeOrientation.docx");
- See Also:
- ShapeBase.FlipOrientation
Field Summary |
static final int | NONE = 0 | |
Coordinates are not flipped.
|
static final int | HORIZONTAL = 1 | |
Flip along the y-axis, reversing the x-coordinates.
|
static final int | VERTICAL = 2 | |
Flip along the x-axis, reversing the y-coordinates.
|
static final int | BOTH = 3 | |
Flip along both the y- and x-axis.
|
NONE = 0 | |
public static final int NONE |
-
Coordinates are not flipped.
HORIZONTAL = 1 | |
public static final int HORIZONTAL |
-
Flip along the y-axis, reversing the x-coordinates.
VERTICAL = 2 | |
public static final int VERTICAL |
-
Flip along the x-axis, reversing the y-coordinates.
BOTH = 3 | |
public static final int BOTH |
-
Flip along both the y- and x-axis.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.