阅读背景:

canvas合成和裁剪

来源:互联网 

canvas合成和裁剪

  1. 属性

    globalCompositeOperation=type       设置覆盖类型
        source-over         源覆盖在目标上
        source-in           源覆盖在目标上的公共部分(只取源图形的部分)
        source-out          源覆盖在目标上以外的部分
        source-atop         源覆盖在目标上的公共部分与目标的交集
        destination-over    目标覆盖在源上
        destination-in      
        destination-out
        destination-atop
        lighter             目标和源公共部分颜色值相加,结果是颜色更亮
        copy                只显示源
        xor                 去除源和目标的公共部分
        multiply            目标和源公共部分颜色值相乘,结果是颜色更暗
        screen              比lighter的效果更light
        overlay             multiply和screen的混合作用
        darken              保留目标和源像素最暗的部分
        lighten             保留目标和源像素最亮的部分
        color-dodge
        color-burn
        hard-light
        soft-light
        difference
        exclusion
        hue
        saturation
        color
        luminosity
    
    ctx.clip();             裁剪一块儿区域globalCompositeOperation=ty



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: