使用形状或图表的发光效果

可能的使用场景

Aspose.Cells 提供了 Shape.Glow 属性来处理形状或图表的发光效果。它包含以下子属性,您可以根据需要设置这些子属性以获得不同的结果。

  • 发光效果.大小
  • 发光效果.透明度

以下截图为Microsoft Excel界面设置形状发光效果。

待办事项:图片_替代_文本

使用形状或图表的发光效果

下面的示例代码加载源文件并访问第一个工作表中的第一个形状并设置 Shape.Glow 属性的子属性,然后将工作簿保存在输出excel文件.

示例代码

// 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");