首页/ 接口索引/ 填充

shape.Fill.Fountain

已有渐变对象:.Colors、.Type、.Angle、.CenterX/Y。

签名

shape.Fill.Fountain

说明

已有渐变对象:.Colors、.Type、.Angle、.CenterX/Y。

Python 示例(可直接运行)

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

if shape.Fill.Type == 2:                       # 2 = 渐变
    f = shape.Fill.Fountain                    # f : 渐变对象
    print("角度:", f.Angle)
    print("色标数:", f.Colors.Count)

    for i in range(1, f.Colors.Count + 1):
        print(i, "位置:", f.Colors.Item(i).Position)

关于本类:填充

单色 / 渐变 / 图案 / 底纹。日常 90% 只用单色。

同类其他接口