【发布时间】:2011-04-14 09:43:52
【问题描述】:
我正在开发一个应用程序,用户可以在其中上传图像并缩放、平移以将图像设置到框架中。
我可以平移和缩放,并将人脸设置在框架上(空白/透明人脸)。用户还能够查看图像。
我最终想要做的是保存一张脸的最终图像 用户已选择,但图像应该是由框架 + 用户面部组成的单个图像 - 可见面部之外的区域。
我面临的问题是我无法删除我不想要的图像部分。
请建议我可以做同样的事情。例子很好,但它们应该用 jQuery/JavaScript 实现。
截图:
代码如下:
<html>
<head>
<script src="file/ga.js" type="text/javascript"></script>
<script src="file/jquery.js" type="text/javascript"></script>
<script src="file/jquery-ui.js" type="text/javascript"></script>
<script src="file/jquery_002.js" type="text/javascript"></script>
<script src="file/axzoomer.js" type="text/javascript"></script>
<script type="text/javascript">
function adjustMe()
{
document.getElementById('layer1').style.z-index = -9999999;
}
</script>
</head>
<div style="width: 100%;">
<div style="position: relative; left: 0px; top: 0px; width: 360px; height: 270px;">
<div style="width:400px;height:400px; background-image:url('frame.png')">
</div>
<!--* frame comes above */-->
<div id="layer1" style="position: absolute; left: 30px; top: 40px; width: 360px; height: 270px;">
<img id="dyn" class="ex ax-zoom" src="peng.jpg" style="width: 360px;opacity: 0.2;filter:alpha(opacity=30); height: 270px; position: absolute; top: 0px; left: 0px;"/>
</div>
<div style="display: none; position: absolute; opacity: 0.5; height: 35px; top: 240px; left: 148px;" class="ax-controls">
<img style="cursor: pointer;" src="file/zoom-in.png">
<img style="cursor: pointer;" src="file/zoom-out.png">
</div>
</div>
</div>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<div style="clear:both;">
<input type="button" value="Done" onclick="adjustMe();"/>
</div>
<script type="text/javascript">
$('.ex').axzoomer({
'maxZoom':4,
'zoomIn':'file/zoom-in.png',
'zoomOut':'file/zoom-out.png',
'opacity':0.5,
'sensivity':10
});
</script>
</body>
【问题讨论】:
标签: php javascript jquery image-manipulation dom