形状のグローエフェクトの色を読み取りたい場合は、{0}プロパティを使用してください。これにより、形状のグローエフェクトの色に関連するさまざまなプロパティがわかります。
Contents
[
Hide
]
可能な使用シナリオ
形状のグローエフェクトの色を読み取りたい場合は、Shape.Glow.Colorプロパティを使用してください。これにより、形状のグローエフェクトの色に関連するさまざまなプロパティがわかります。
シェイプのグローエフェクトの色を読む
参照のために、以下はサンプルコードとその ソースエクセルファイル およびコンソール出力を示したスクリーンショットです。次のスクリーンショットは、Microsoft Excelで表示したときのソースエクセルファイル内の形状のグローエフェクトを示しています。
C#コード:形状のグローエフェクトの色を読み取る
This file contains 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-.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