首页/ 接口索引/ 透明度与混合模式

shape.Transparency.ApplyFountainTransparency(Start, End)

渐变透明:一端透明一端不透明,做"图淡入背景"、"边缘虚化"最自然。Start/End 也是 0~100。

签名

shape.Transparency.ApplyFountainTransparency(Start, End)

说明

渐变透明:一端透明一端不透明,做"图淡入背景"、"边缘虚化"最自然。Start/End 也是 0~100。

Python 示例(可直接运行)

依赖 pywin32。示例假定 app / doc / page / layer 已就绪。 见「连接与初始化」
Python
shape = app.ActiveSelectionRange(1)

try:
    shape.Transparency.ApplyFountainTransparency(0, 100)
    # 0 = 起点不透明,100 = 终点全透明
    print("渐变透明已套用,类型:", shape.Transparency.Type)
except Exception as e:
    print("渐变透明失败:", e)

关于本类:透明度与混合模式

每个形状都有 Transparency 对象,不管当前有没有透明。透明度值是 0~100 的整数,0 完全不透明,100 完全透明。

同类其他接口