处理形状或图表的发光效果
Contents
[
Hide
]
可能的使用场景
Aspose.Cells提供Shape.Glow属性来处理形状或图表的发光效果。它包含以下子属性,您可以根据需求进行设置以实现不同的效果。
- GlowEffect.Size
- GlowEffect.Transparency
以下截图显示了Microsoft Excel界面设置形状的发光效果。
处理形状或图表的发光效果
以下示例代码加载了源Excel文件,并访问了第一个工作表中的第一个形状,并设置了Shape.Glow属性的子属性,然后将工作簿保存为 输出Excel文件。
示例代码
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 | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(WorkingWithGlowEffect.class) + "articles/"; | |
// Load your source excel file | |
Workbook wb = new Workbook(dataDir + "WorkingWithGlowEffect_in.xlsx"); | |
// Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
// Access first shape | |
Shape sh = ws.getShapes().get(0); | |
// Set the glow effect of the shape | |
// Set its Size and Transparency properties | |
GlowEffect ge = sh.getGlow(); | |
ge.setSize(30); | |
ge.setTransparency(0.4); | |
// Save the workbook in xlsx format | |
wb.save(dataDir + "WorkingWithGlowEffect_out.xlsx"); |