C++経由のNode.jsを使ったシェイプまたはチャートのシャドウ効果の操作

可能な使用シナリオ

Aspose.Cells for Node.js via C++は、Shape.getShadowEffect()プロパティとShadowEffectクラスを提供し、シェイプやチャートのシャドウ効果を操作します。ShadowEffectクラスは、さまざまな結果を得るために設定可能な以下のプロパティを含みます。

図形またはグラフの影効果の操作

次のサンプルコードは、ソース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"));