Ändra justeringsvärden för formen
Contents
[
Hide
]
Aspose.Cells tillhandahållerShape.Geometry.ShapeAdjustValues egenskap för att göra ändringar i justeringspunkterna med former. I Microsoft Excel-gränssnittet visas justeringar som gula diamantnoder. Till exempel:
- Rundad rektangel har en justering för att ändra bågen
- Triangeln har en justering för att ändra platsen för punkten
- Trapets har en justering för att ändra toppens bredd
- Pilarna har två justeringar för att ändra formen på huvudet och svansen
Den här artikeln kommer att förklara användningen avShape.Geometry.ShapeAdjustValues egenskap för att ändra justeringsvärdet för de olika formerna.
Kodexemplet nedan visar hur man ändrar justeringsvärden för formen.
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"); |