跳到主要内容

ArcTo

使用指定的宽度和高度半径、起始角度和扫描角度从当前点绘制弧线。

语法

expression.ArcTo(wR, hR, stAng, swAng);

expression - 表示 ApiPath 类的变量。

参数

名称必需/可选数据类型默认值描述
wR必需GeometryCoordinate宽度半径。
hR必需GeometryCoordinate高度半径。
stAng必需GeometryCoordinate起始角度。
swAng必需GeometryCoordinate扫描角度。

返回值

此方法不返回任何数据。

示例

使用各种贝塞尔和弧线命令创建复杂的曲线形状。

// Demonstrates different curve types in a single path on a slide.
let presentation = Api.GetPresentation();
let slide = presentation.GetSlideByIndex(0);
let customGeometry = Api.CreateCustomGeometry();
let path = customGeometry.AddPath();
path.SetWidth(120 * 36000);
path.SetHeight(120 * 36000);
path.MoveTo(0, 60 * 36000);
path.CubicBezTo(0, 0, 60 * 36000, 0, 60 * 36000, 60 * 36000);
path.QuadBezTo(120 * 36000, 60 * 36000, 120 * 36000, 120 * 36000);
path.ArcTo(60 * 36000, 60 * 36000, 0, 10800000);
path.Close();
let fill = Api.CreateSolidFill(Api.RGB(100, 150, 200));
let stroke = Api.CreateStroke(36000, Api.CreateSolidFill(Api.RGB(50, 75, 100)));
let shape = Api.CreateShape("rect", 120 * 36000, 120 * 36000, fill, stroke);
shape.SetGeometry(customGeometry);
shape.SetPosition(2000000, 1000000);
slide.AddObject(shape);