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

可能的使用场景

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

使用形状或图表的反射效果

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

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

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Load your source excel file
const workbook = new AsposeCells.Workbook(path.join(dataDir, "sample.xlsx"));

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

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

// Set the reflection effect of the shape, set its Blur, Size, Transparency and Distance properties
const reflectionEffect = shape.getReflection();
reflectionEffect.setBlur(30);
reflectionEffect.setSize(90);
reflectionEffect.setTransparency(0);
reflectionEffect.setDistance(80);

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