シェイプの調整値の変更

図形の調整値を変更

次のサンプルコードでは、ソースのExcelファイルの最初のワークシートの最初の3つの図形にアクセスし、その後、図形の調整値を変更します。以下のスクリーンショットは、調整値を変更する前の図形の外観と、調整値を変更した後の図形の外観を示しています。

調整値を変更する前の図形描画

todo:image_alt_text

調整値を変更した後の図形描画

todo:image_alt_text

// 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.getDataDir(ChangeAdjustmentValuesOfShape.class);
// Create workbook object from source excel file
Workbook workbook = new Workbook(dataDir + "source.xlsx");
// Access first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
// Access first three shapes of the worksheet
Shape shape1 = worksheet.getShapes().get(0);
Shape shape2 = worksheet.getShapes().get(1);
Shape shape3 = worksheet.getShapes().get(2);
// Change the adjustment values of the shapes
shape1.getGeometry().getShapeAdjustValues().get(0).setValue(0.5d);
shape2.getGeometry().getShapeAdjustValues().get(0).setValue(0.8d);
shape3.getGeometry().getShapeAdjustValues().get(0).setValue(0.5d);
// Save the workbook
workbook.save(dataDir + "output.xlsx");