Modifica i valori di regolazione della forma
Aspose.Cells fornisce la proprietà Shape.Geometry.ShapeAdjustValues per apportare modifiche ai punti di regolazione con le forme. Nell’interfaccia utente di Microsoft Excel, le regolazioni vengono visualizzate come nodi a diamante giallo. Ad esempio:
- Il rettangolo arrotondato ha una regolazione per cambiare l’arco
- Il triangolo ha una regolazione per cambiare la posizione del punto
- Il trapezio ha un’aggiustamento per cambiare la larghezza del lato superiore
- Le frecce hanno due ajustamenti per cambiare la forma della testa e della coda
Questo articolo spiegherà l’uso della proprietà Shape.Geometry.ShapeAdjustValues per cambiare il valore di regolazione delle diverse forme.
Il seguente esempio di codice mostra come cambiare i valori di regolazione della forma.
// 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"); |