gpt4 book ai didi

javascript - jCanvas 的 globalCompositeOperation

转载 作者:行者123 更新时间:2023-11-29 20:00:52 25 4
gpt4 key购买 nike

我如何将 globalCompositeOperation(或任何其他可以给我“multiply”颜色操作的插件)集成到 jCanvas 中jQuery 插件?

// How do I get this working? //
var ctx = document.getElementById('canvas').getContext('2d');
ctx.globalCompositeOperation = 'darker';

// With this - //
$("canvas").drawArc({
fillStyle: "#c7302a",
x: 100, y: 100,
radius: 50
});

$("canvas").drawArc({
fillStyle: "#395797",
x: 170, y: 100,
radius: 50,
opacity: 1
});

最佳答案

郑重声明,jCanvas 有一个compositing 属性,其值映射到ctx.globalCompositeOperation

$("canvas").drawArc({
fillStyle: "#c7302a",
x: 100, y: 100,
radius: 50,
compositing: 'darker'
});

-迦勒

关于javascript - jCanvas 的 globalCompositeOperation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14612931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com