跳到主要内容

Copy

创建指定绘图对象的副本。

备注

此功能仅在 ONLYOFFICE Docs 付费版本中可用。

语法

expression.Copy();

expression - 表示 ApiDrawing 类的变量。

参数

此方法没有任何参数。

返回值

ApiDrawing

示例

在工作表上复制绘图并将副本放在电子表格中原始绘图旁边。

// How do I make a copy of a drawing in a spreadsheet?

// Clone a drawing and add the copy to the sheet at a different cell anchor in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let shape = worksheet.AddShape("flowChartOnlineStorage", 60 * 36000, 35 * 36000, fill, stroke, 0, 2 * 36000, 2, 3 * 36000);

let copyDrawing = shape.Copy();
worksheet.AddDrawing(copyDrawing, 4, 2 * 36000, 2, 3 * 36000);