处理形状或图表的倒影效果

可能的使用场景

Aspose.Cells提供了Shape.Reflection属性以及ReflectionEffect类,用于处理形状或图表的倒影效果。ReflectionEffect类包含以下属性,可以根据应用程序要求进行设置以实现不同的结果。

使用形状或图表的反射效果

以下示例代码加载源Excel文件,并访问默认工作表中的第一个形状,并设置Shape.Reflection类的不同属性,然后将工作簿保存为输出Excel文件

// 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);
// Load your source excel file
Workbook wb = new Workbook(dataDir + "sample.xlsx");
// Access first worksheet
Worksheet ws = wb.Worksheets[0];
// Access first shape
Shape sh = ws.Shapes[0];
// Set the reflection effect of the shape, set its Blur, Size, Transparency and Distance properties
ReflectionEffect re = sh.Reflection;
re.Blur = 30;
re.Size = 90;
re.Transparency = 0;
re.Distance = 80;
// Save the workbook in xlsx format
wb.Save(dataDir + "output_out.xlsx");