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

shape.Transparency.MergeMode

混合模式(正片叠底、滤色、叠加…)。枚举值在不同版本有偏移,别硬背数字:先读出来对照 UI,改的时候只动这一个数。

签名

shape.Transparency.MergeMode

说明

混合模式(正片叠底、滤色、叠加…)。枚举值在不同版本有偏移,别硬背数字:先读出来对照 UI,改的时候只动这一个数。

Python 示例(可直接运行)

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

shape.Transparency.ApplyUniformTransparency(40)
print("当前混合模式代号:", shape.Transparency.MergeMode)

# 改之前先把原值记下来,改坏了能还原
old = shape.Transparency.MergeMode
shape.Transparency.MergeMode = old
print("模式可以写回,说明这个属性是读写属性")

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

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

同类其他接口