确定形状是否为智能艺术形状
Contents
[
Hide
]
可能的使用场景
智能艺术形状是 Microsoft Excel 中的特殊形状,可让您自动创建复杂的图表。您可以使用以下方法查找形状是智能艺术形状还是普通形状Shape.IsSmartArt财产。
确定形状是否为智能艺术形状
下面的示例代码加载示例 Excel 文件包含智能艺术形状,如此屏幕截图所示。然后它打印值Shape.IsSmartArt第一个形状的属性。请查看下面给出的示例代码的控制台输出。
示例代码
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-Java | |
//Load the sample smart art shape - Excel file | |
Workbook wb = new Workbook("sampleSmartArtShape.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
//Access first shape | |
Shape sh = ws.getShapes().get(0); | |
//Determine if shape is smart art | |
System.out.println("Is Smart Art Shape: " + sh.isSmartArt()); |
控制台输出
Is Smart Art Shape: true