我有一个带有图像的画布元素。
现在,当我单击一个按钮时,我尝试在画布中旋转图像:
$("#rotateC").live('click',function(e) {
e.preventDefault();
console.log("rotateC");
Pixastic.process(firstImg, 'rotate',
{
'angle': +90,
'leaveDOM': true
},
function(firstImg) {
ctx.drawImage(firstImg, 0, 0);
}
);
});图像将旋转一次,然后如果我再次单击该按钮,则没有任何反应。
你知道问题出在哪里吗?
发布于 2012-03-29 03:59:01
您可以在jquery中使用How to rotate with pixastic jquery和his demo来解决您的问题!(希望这对你来说没问题)
$(function(){
$('#rotate').live('click',function() {
$("#img1").pixastic("rotate", {angle:90});
});
});如果您的按钮具有id rotate,而您的图像具有id img1,则应该可以正常工作。
https://stackoverflow.com/questions/9910086
复制相似问题