SetFlipH
Sets the horizontal flip of the current drawing.
Syntax
expression.SetFlipH(bFlip);
expression - A variable that represents a ApiDrawing class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| bFlip | Required | boolean | Specifies if the figure will be flipped horizontally or not. |
Returns
boolean
Example
Mirror an object left-to-right on a slide in a presentation.
// How do I flip a shape horizontally in a presentation?
// Create a shape, reverse it horizontally, and display the result in a presentation.
const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();
const fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const drawing = Api.CreateShape("cube", 300 * 36000, 130 * 36000, fill, stroke);
drawing.SetPosition(608400, 1267200);
drawing.SetFlipH(true);
const flip = drawing.GetFlipH();
const docContent = drawing.GetDocContent();
const paragraph = docContent.GetElement(0);
paragraph.SetJc("left");
paragraph.AddText("Drawing is flipped horizontally: " + flip);
slide.AddObject(drawing);