シェイプの調整値を変更する
Contents
[
Hide
]
Aspose.Cells提供Shape.Geometry.ShapeAdjustValuesプロパティを使用して、シェイプを使用して調整ポイントを変更します。 Microsoft Excel UI では、調整は黄色のひし形ノードとして表示されます。例えば:
- 角丸長方形には、円弧を変更するための調整があります
- 三角形には、ポイントの位置を変更するための調整があります
- 台形は、トップの幅を変更する調整があります
- 矢印には、頭と尾の形状を変更するための 2 つの調整があります。
この記事では、の使用について説明します。Shape.Geometry.ShapeAdjustValuesプロパティを使用して、さまざまな形状の調整値を変更します。
以下のコード サンプルは、シェイプの調整値を変更する方法を示しています。
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); | |
// Create workbook object from source excel file | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
// Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Access first three shapes of the worksheet | |
Shape shape1 = worksheet.Shapes[0]; | |
Shape shape2 = worksheet.Shapes[1]; | |
Shape shape3 = worksheet.Shapes[2]; | |
// Change the adjustment values of the shapes | |
shape1.Geometry.ShapeAdjustValues[0].Value = 0.5d; | |
shape2.Geometry.ShapeAdjustValues[0].Value = 0.8d; | |
shape3.Geometry.ShapeAdjustValues[0].Value = 0.5d; | |
// Save the workbook | |
workbook.Save(dataDir + "output_out.xlsx"); |