Working with the Reflection Effect of Shape or Chart
Contents
[
Hide
]
Possible Usage Scenarios
Aspose.Cells provides the Shape.Reflection property along with ReflectionEffect class to work with the reflection effect of shape or chart. The ReflectionEffect class contains the following properties which can be set to achieve different results as per application requirements.
Working with the Reflection Effect of Shape or Chart
The following sample code loads the source excel file and accesses the first shape in the default worksheet and sets different properties of Shape.Reflection class and then saves the workbook in the output excel file.
This file contains hidden or 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-.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"); |