図形またはグラフの3 D形式の操作
Contents
[
Hide
]
可能な使用シナリオ
Aspose.Cellsは、図形やグラフの3-D形式を操作するためのShape.ThreeDFormat プロパティを提供します。異なる結果を得るために設定できるさまざまなサブプロパティが含まれています。
以下のスクリーンショットは、Shapeの3-D形式の設定を示しています。
図形またはグラフの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-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(WorkingWithThreeDFormat.class) + "articles/"; | |
//Load excel file containing a shape | |
Workbook wb = new Workbook(dataDir + "WorkingWithThreeDFormat_in.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
//Access first shape | |
Shape sh = ws.getShapes().get(0); | |
//Apply different three dimensional settings | |
ThreeDFormat n3df = sh.getThreeDFormat(); | |
n3df.setContourWidth(17); | |
n3df.setExtrusionHeight(32); | |
n3df.setTopBevelType(BevelType.HARD_EDGE); | |
n3df.setTopBevelWidth (30); | |
n3df.setTopBevelHeight(30); | |
//Save the output excel file in xlsx format | |
wb.save(dataDir + "WorkingWithThreeDFormat_out.xlsx"); |