シェイプのグロー効果の色を読み取る

考えられる使用シナリオ

任意の形状のグロー効果の色を読み取りたい場合は、シェイプ.グロー.カラー財産。シェイプのグロー効果の色に関連するさまざまなプロパティを見つけるのに役立ちます。

シェイプのグロー効果の色を読み取る

次のサンプル コードとそのコードを参照してください。ソースエクセルファイル参照用のコンソール出力。次のスクリーンショットは、Microsoft Excel で表示した場合のソース Excel ファイル内の形状のグロー効果を示しています。

todo:画像_代替_文章

C# 図形の色のグロー効果を読み取るコード

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Read the source excel file
Workbook book = new Workbook(dataDir + "sourceGlowEffectColor.xlsx");
// Access first worksheet
Worksheet sheet = book.Worksheets[0];
// Access the shape
Shape shape = sheet.Shapes[0];
// Read the glow effect color and its various properties
GlowEffect effect = shape.Glow;
CellsColor color = effect.Color;
Console.WriteLine("Color: " + color.Color);
Console.WriteLine("ColorIndex: " + color.ColorIndex);
Console.WriteLine("IsShapeColor: " + color.IsShapeColor);
Console.WriteLine("Transparency: " + color.Transparency);
Console.WriteLine("Type: " + color.Type);

コンソール出力

上記のサンプル コードを提供されたコマンドで実行した場合のコンソール出力は次のとおりです。ソースエクセルファイル.

Color: Color [A=222, R=255, G=0, B=0]ColorIndex: 16711672

IsShapeColor: True

Transparency: 0.13

Type: RGB