C++を使用してシェイプやチャートのグロー効果を操作する
Contents
[
Hide
]
可能な使用シナリオ
Aspose.Cellsは、Shape.GlowプロパティとGlowEffectクラスを提供し、シェイプやチャートのグロー効果を操作します。 GlowEffectクラスには、さまざまな結果を得るために設定可能な次のプロパティが含まれています。
形状またはチャートのグローエフェクトの操作
以下のサンプルコードは、ソースExcelファイルを読み込み、最初のワークシートの最初のシェイプにアクセスし、Shape.Glowのサブプロパティを設定し、その後ワークブックを出力Excelファイルに保存します。
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
using namespace Aspose::Cells::Drawing;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Load your source excel file
Workbook wb(srcDir + u"sample.xlsx");
// Access first worksheet
Worksheet ws = wb.GetWorksheets().Get(0);
// Access first shape
Shape sh = ws.GetShapes().Get(0);
// Set the glow effect of the shape, Set its Size and Transparency properties
GlowEffect ge = sh.GetGlow();
ge.SetSize(30);
ge.SetTransparency(0.4);
// Save the workbook in xlsx format
wb.Save(outDir + u"output_out.xlsx");
std::cout << "Glow effect applied successfully!" << std::endl;
Aspose::Cells::Cleanup();
}