シェイプのグローエフェクトの色を読み取る
Contents
[
Hide
]
可能な使用シナリオ
任意の形状のグローエフェクトの色を読み取りたい場合は、Shape.Glow.Colorプロパティを使用してください。これにより、形状に適用されたグローエフェクトの色に関連するさまざまなプロパティが見つかります。
シェイプのグローエフェクトの色を読む
次のサンプルコードとそのソースExcelファイル、および参照用のコンソール出力をご覧ください。次のスクリーンショットは、Microsoft ExcelでソースExcelファイル内の形状のグローエフェクトを表示したものです。
シェイプのグローエフェクトの色を読むためのJavaコード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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()); |
サンプルコードによって生成されたコンソール出力
上記のサンプルコードを提供されたソースExcelファイルで実行した場合のコンソール出力は、次のとおりです。
Color: com.aspose.cells.Color@deff0000
ColorIndex: 16711672
IsShapeColor: true
Transparency: 0.13
Type: 2