通过Node.js使用C++处理Shape或Chart的阴影效果

可能的使用场景

Aspose.Cells for Node.js via C++提供Shape.getShadowEffect()属性和ShadowEffect类,用于处理形状或图表的阴影效果。ShadowEffect类包含若干属性,可根据应用需求设置以实现不同效果。

使用 Aspose.Cells 处理形状或图表的阴影效果

以下示例代码加载源Excel文件,访问第一个工作表中的第一个形状,设置Shape.getShadowEffect()属性的子属性,然后将工作簿保存为输出Excel文件

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Load your source excel file
const workbook = new AsposeCells.Workbook(filePath);

// Access first worksheet
const worksheet = workbook.getWorksheets().get(0);

// Access first shape
const shape = worksheet.getShapes().get(0);

// Set the shadow effect of the shape, set its Angle, Blur, Distance and Transparency properties
const shadowEffect = shape.getShadowEffect();
shadowEffect.setAngle(150);
shadowEffect.setBlur(4);
shadowEffect.setDistance(45);
shadowEffect.setTransparency(0.3);

// Save the workbook in xlsx format
workbook.save(path.join(dataDir, "output_out.xlsx"));