首页/ 接口索引/ 位图处理

shape.ApplyEffectInvert() / ApplyEffectGamma() / ApplyEffectPosterize()

直接给位图套调色效果:反相、伽马、色调分离。这些是 Shape 上的方法,不是 Bitmap 上的,别找错对象。

签名

shape.ApplyEffectInvert() / ApplyEffectGamma() / ApplyEffectPosterize()

说明

直接给位图套调色效果:反相、伽马、色调分离。这些是 Shape 上的方法,不是 Bitmap 上的,别找错对象。

Python 示例(可直接运行)

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

if shape.Type == 5:
    try:
        shape.ApplyEffectInvert()                   # 反相
        print("已反相")
    except Exception as e:
        print("反相失败:", e)

    try:
        shape.ApplyEffectPosterize()                # 色调分离
        print("已做色调分离")
    except Exception as e:
        print("色调分离失败:", e)

关于本类:位图处理

位图对象挂在 shape.Bitmap 上,前提是 shape.Type == 5。分辨率、像素尺寸、颜色模式、重新采样都在这里。

同类其他接口