C++経由のNode.jsを使ったシェイプまたはチャートの反射効果の操作
Contents
[
Hide
]
可能な使用シナリオ
Aspose.Cells for Node.js via C++は、Shape.getReflection()プロパティとReflectionEffectクラスを提供し、シェイプやチャートの反射効果を操作できます。ReflectionEffectクラスは、さまざまな結果を得るために設定可能な以下のプロパティを含みます。
- ReflectionEffect.getBlur()
- ReflectionEffect.getDirection()
- ReflectionEffect.getDistance()
- ReflectionEffect.getFadeDirection()
- ReflectionEffect.getRotWithShape()
- ReflectionEffect.getSize()
- ReflectionEffect.getTransparency()
- ReflectionEffect.getType()
図形またはグラフの反射効果の操作
以下のサンプルコードは、ソース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"));