[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IShapes.AddShape

AddShape Method

AddShape(AutoShapeType, double, double, double, double)

返回代表工作表中新增自动形状的IShape 对象。

Declaration
IShape AddShape(AutoShapeType type, double left, double top, double width, double height)
Parameters
Type Name Description
AutoShapeType type

指定要创建的自动形状类型。

double left

自动形状边框左上角相对于文档左上角的位置(以点为单位)。

double top

自动形状边框左上角相对于文档左上角的位置(以点为单位)。

double width

自动形状边框的宽度和高度,以点为单位。

double height

自动形状边框的宽度和高度,以点为单位。

Returns
Type Description
IShape

IShape 对象。

AddShape(AutoShapeType, IRange)

返回代表当前工作表上指定范围内新自动形状的IShape 对象。
目标范围的目标工作表和被添加的形状的工作表必须是同一工作表。

Declaration
IShape AddShape(AutoShapeType type, IRange targetRange)
Parameters
Type Name Description
AutoShapeType type

指定要创建的自动形状类型。

IRange targetRange

当前工作表的目标范围。

Returns
Type Description
IShape

IShape 对象。

AddShape(string, AutoShapeType, double, double, double, double)

返回代表工作表中新增自动形状的IShape 对象。

Declaration
IShape AddShape(string name, AutoShapeType type, double left, double top, double width, double height)
Parameters
Type Name Description
string name

形状名称。

AutoShapeType type

指定要创建的自动形状类型。

double left

自动形状边框左上角相对于文档左上角的位置(以点为单位)。

double top

自动形状边框左上角相对于文档左上角的位置(以点为单位)。

double width

自动形状边框的宽度和高度,以点为单位。

double height

自动形状边框的宽度和高度,以点为单位。

Returns
Type Description
IShape

IShape 对象。

AddShape(string, AutoShapeType, IRange)

返回代表当前工作表上指定范围内新自动形状的IShape 对象。
目标范围的目标工作表和被添加的形状的工作表必须是同一工作表。

Declaration
IShape AddShape(string name, AutoShapeType type, IRange targetRange)
Parameters
Type Name Description
string name

形状名称。

AutoShapeType type

指定要创建的自动形状类型。

IRange targetRange

当前工作表的目标范围。

Returns
Type Description
IShape

IShape 对象。