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

考えられる使用シナリオ

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

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

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

todo:画像_代替_文章

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

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(ReadColorGlowEffect.class) + "DrawingObjects/";
//Read the source excel file
Workbook wb = new Workbook(dataDir + "sourceGlowEffectColor.xlsx");
//Access first worksheet
Worksheet ws = wb.getWorksheets().get(0);
//Access the shape
Shape sh = ws.getShapes().get(0);
//Read the glow effect color and its various properties
GlowEffect ge = sh.getGlow();
CellsColor clr = ge.getColor();
System.out.println("Color: " + clr.getColor());
System.out.println("ColorIndex: " + clr.getColorIndex());
System.out.println("IsShapeColor: " + clr.isShapeColor());
System.out.println("Transparency: " + clr.getTransparency());
System.out.println("Type: " + clr.getType());

サンプル コードによって生成されたコンソール出力

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

Color: com.aspose.cells.Color@deff0000

ColorIndex: 16711672

IsShapeColor: true

Transparency: 0.13

Type: 2