図形またはグラフの3 D形式の操作
Contents
[
Hide
]
可能な使用シナリオ
Aspose.Cellsでは、3-Dフォーマットの形状やチャートを操作するために、Shape.ThreeDFormatプロパティとThreeDFormatクラスが提供されます。 ThreeDFormatクラスには、アプリケーションの要件に応じて異なる結果を得るために設定できるさまざまなプロパティが含まれています。
図形またはグラフの3-D形式の操作
次のサンプルコードは、ソースエクセルファイルをロードし、最初のワークシートの最初の図形にアクセスし、Shape.ThreeDFormatプロパティのサブプロパティを設定し、その後、ワークブックを出力エクセルファイル で保存します。
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 excel file containing a shape | |
Workbook wb = new Workbook(dataDir + "sample.xlsx"); | |
// Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
// Access first shape | |
Shape sh = ws.Shapes[0]; | |
// Apply different three dimensional settings | |
ThreeDFormat n3df = sh.ThreeDFormat; | |
n3df.ContourWidth = 17; | |
n3df.ExtrusionHeight = 32; | |
// Save the output excel file in xlsx format | |
wb.Save(dataDir + "output_out.xlsx"); |