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

shape.Transparency.Type

当前透明类型(无 / 均匀 / 渐变 / 图案 / 底纹),只读。用来判断"这个形状到底有没有透明"。

签名

shape.Transparency.Type

说明

当前透明类型(无 / 均匀 / 渐变 / 图案 / 底纹),只读。用来判断"这个形状到底有没有透明"。

Python 示例(可直接运行)

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

t = shape.Transparency.Type
print("透明类型代号:", t)                            # 0=无 1=均匀 ...

if t == 0:
    print("这个形状没有透明")
    shape.Transparency.ApplyUniformTransparency(30)
    print("已加上 30% 透明")

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

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

同类其他接口