【发布时间】:2014-11-26 04:10:47
【问题描述】:
我试图在 KineticJS 中模拟这个 other's Stackoverflow canvas clipping function 并具有可拖动图像的附加功能,但我无法完成。
小提琴:http://jsfiddle.net/dekaa/6L1wxt1g/
shape = new Kinetic.Shape({
sceneFunc:function(ctx){
ctx.drawImage(clipping_mask,0,0);
ctx.globalCompositeOperation = "source-in";
ctx.drawImage(main_image,0,0);
},
draggable:true
});
尝试使用sceneFunc 功能,当我使用它时,可拖动功能不起作用。那么问题是它可以在 KineticJS 中完成吗?
【问题讨论】:
标签: javascript html kineticjs clip