Shapes.AddCurve 方法 (Publisher)

将表示贝塞尔曲线的新 Shape 对象添加到指定的 Shapes 集合。

语法

表达式AddCurve (SafeArrayOfPoints)

expression:一个表示 Shapes 对象的变量。

参数

名称 必需/可选 数据类型 说明
SafeArrayOfPoints 必需 Variant 由指定曲线的顶点和控制点的坐标对组成的数组。 指定的第一个点是起始顶点,接下来的两个点是第一个贝塞尔段的控制点。

对于曲线的每个附加段,可以指定一个顶点和两个控制点。 指定的最后一个点是曲线的结束顶点。 请注意,必须指定的点数始终为 3n + 1,其中 n 为曲线的线段个数。

返回值

Shape

说明

对于 SafeArrayOfPoints 中的数组元素,数值以 为单位计算;字符串可以位于 Microsoft Publisher (支持的任何单元中,例如,“2.5 in”) 。

示例

以下示例将一条双段贝赛尔曲线添加到当前出版物的第一页。

Dim shpCurve As Shape 
Dim arrPoints(1 To 4, 1 To 2) As Single 
 
arrPoints(1, 1) = 0 
arrPoints(1, 2) = 0 
arrPoints(2, 1) = 72 
arrPoints(2, 2) = 72 
arrPoints(3, 1) = 144 
arrPoints(3, 2) = 36 
arrPoints(4, 1) = 216 
arrPoints(4, 2) = 108 
 
Set shpCurve = ActiveDocument.Pages(1).Shapes.AddCurve _ 
 (SafeArrayOfPoints:=arrPoints)

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。