【发布时间】:2012-04-16 17:53:25
【问题描述】:
我正在寻找很长时间的解决方案,但我找不到任何地方。如果我有这个 html 代码的例子:
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.Jcrop.js" type="text/javascript"></script>
</head>
<table>
<img src="picture.jpg" id="picture" style="display:none"/>
<tr>
<td>
<canvas id="rotate"></canvas>
</td>
</tr>
</table>
<p>
<strong>Rotate Image: </strong>
<a href="javascript:;" id="resetImage">Reset Image</a>
<a href="javascript:;" id="rotate90">90°</a>
</p>
</html>
我想用一些 javascript 旋转功能旋转图像,然后我需要用 jCrop 插件裁剪它们。有没有办法用 jCrop 插件处理画布对象。我试着这样做,但没有工作:
jQuery(function($) {
$('#rotate').Jcrop({
bgColor: 'black',
bgOpacity: .8,
setSelect: [ 10, 10, 200, 300 ],
aspectRatio: 2 / 3
});
});
有人可以帮帮我吗?
【问题讨论】:
标签: html object image-processing canvas jcrop