使用形状或图表的阴影效果
Contents
[
Hide
]
可能的使用场景
Aspose.Cells for Python via .NET 提供[Shape.shadow_effect]属性和[ShadowEffect]类,用于处理形状或图表的阴影效果。[ShadowEffect]类包含多个属性,可根据应用需求设置以达到不同效果。
使用 Aspose.Cells 处理形状或图表的阴影效果
以下示例代码加载源 excel 文件,访问第一个工作表中的第一个形状,设置[Shape.shadow_effect]的子属性,然后保存工作簿为输出 excel 文件。
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
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Load your source excel file | |
wb = Workbook(dataDir + "sample.xlsx") | |
# Access first worksheet | |
ws = wb.worksheets[0] | |
# Access first shape | |
sh = ws.shapes[0] | |
# Set the shadow effect of the shape, Set its Angle, Blur, Distance and Transparency properties | |
se = sh.shadow_effect | |
se.angle = 150.0 | |
se.blur = 4.0 | |
se.distance = 45.0 | |
se.transparency = 0.3 | |
# Save the workbook in xlsx format | |
wb.save(dataDir + "output_out.xlsx") |