本文介绍了单击该图像时将图像添加到画布?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有cnavas设计,看起来像女孩的身体,当我点击任何图像,如(面料,衬衫),然后该图像将填充该设计。如果我点击面料然后它填充设计的袖子部分,如果我点击衬衫然后它填写身体部分。
这里的参考是链接
[]
这里是我设计的女孩身体部位
I have cnavas design which looks like girl body,when i click on any image like (fabric,blouse) then that image will fill on that design. if i click fabric then it fill on sleeve part of design,if i click blouse then it fill in body part.
for reference here is link
http://www.houseofblouse.com/design/u-neck-2[^]
here is my design which is for girl body part
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
</head>
<body>
<canvas id="myCanvas" width="700" height="800"></canvas>
<script>
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.beginPath();
context.moveTo(3, 20);
context.lineTo(10, 200);
context.stroke();
context.beginPath();
context.moveTo(155, 20);
context.lineTo(150, 200);
context.stroke();
context.beginPath();
context.moveTo(10, 200);
context.lineTo(150, 200);
context.stroke();
context.beginPath();
context.moveTo(3, 20);
context.lineTo(45, 20);
context.stroke();
context.beginPath();
context.moveTo(155, 20);
context.lineTo(110, 20);
context.stroke();
context.beginPath();
context.moveTo(45, 20);
context.bezierCurveTo(48, 80, 110, 80, 110, 19);
context.stroke();
</script>
</body>
</html>
推荐答案
这篇关于单击该图像时将图像添加到画布?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!