Modifica i valori di regolazione della forma

Modifica i valori di regolazione della forma

Il codice di esempio seguente accede alle prime tre forme del primo foglio di lavoro nel file Excel di origine e quindi modifica i valori di regolazione delle forme. Gli screenshot di seguito mostrano l’aspetto delle forme prima di modificare i valori di regolazione e quindi dopo aver modificato i valori di regolazione.

Disegno di forme prima di modificare i valori di regolazione

cose da fare:immagine_alt_testo

Disegno di forme dopo aver modificato i valori di regolazione

cose da fare:immagine_alt_testo

// 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");