図形またはグラフの反射効果の操作
Contents
[
Hide
]
可能な使用シナリオ
Aspose.Cellsは、形状やチャートのリフレクションエフェクトを操作するための Shape.Reflection プロパティと ReflectionEffect クラスを提供しています。 ReflectionEffect クラスには、アプリケーションの要件に応じて異なる結果を得るために設定できる以下のプロパティが含まれています。
図形またはグラフの反射効果の操作
以下のサンプルコードは、ソースエクセルファイル を読み込み、デフォルトのワークシート内の最初の形状にアクセスし、Shape.Reflection クラスのさまざまなプロパティを設定し、その後、ワークブックを 出力エクセルファイル に保存します。
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); | |
// Load your source excel file | |
Workbook wb = new Workbook(dataDir + "sample.xlsx"); | |
// Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
// Access first shape | |
Shape sh = ws.Shapes[0]; | |
// Set the reflection effect of the shape, set its Blur, Size, Transparency and Distance properties | |
ReflectionEffect re = sh.Reflection; | |
re.Blur = 30; | |
re.Size = 90; | |
re.Transparency = 0; | |
re.Distance = 80; | |
// Save the workbook in xlsx format | |
wb.Save(dataDir + "output_out.xlsx"); |