从形状中获取连接点

Contents
[ ]

Aspose.Cells 提供丰富的功能来管理电子表格中的形状。有时需要获取形状的连接点,以便将形状对齐或放置在适当的位置。为此,需要所有连接点。以下代码可用于获取形状的连接点列表,其中形状.GetConnectionPoints()功能被使用。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// Instantiate a new Workbook.
Workbook workbook = new Workbook();
// Get the first worksheet in the book.
Worksheet worksheet = workbook.getWorksheets().get(0);
// Add a new textbox to the collection.
int textboxIndex = worksheet.getTextBoxes().add(2, 1, 160, 200);
// Access your text box which is also a shape object from shapes collection
Shape shape = workbook.getWorksheets().get(0).getShapes().get(0);
// Get all the connection points in this shape
zo[] ConnectionPoints = shape.getConnectionPoints();