Arbeta med reflektionseffekten av form eller diagram med Node.js via C++
Möjliga användningsscenario
Aspose.Cells for Node.js via C++ tillhandahåller egenskapen Shape.getReflection() tillsammans med klassen ReflectionEffect för att arbeta med reflektionseffekten av form eller diagram. Klassen ReflectionEffect innehåller följande egenskaper som kan ställas in för att uppnå olika resultat enligt applikationskrav.
- ReflectionEffect.getBlur()
- ReflectionEffect.getDirection()
- ReflectionEffect.getDistance()
- ReflectionEffect.getFadeDirection()
- ReflectionEffect.getRotWithShape()
- ReflectionEffect.getSize()
- ReflectionEffect.getTransparency()
- ReflectionEffect.getType()
Att arbeta med reflektionseffekten i formen eller diagrammet
Följande exempelkod laddar källexcel-filen och hämtar den första formen i standardarbetsbladet. Den ställer in olika egenskaper för Shape.getReflection() och sparar sedan arbetsboken i utdata excel-fil.
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"));