问答详情
源自:-

用clip剪辑之后会有一个黑色的圆圈

var canvas = document.getElementById("canvas");

var context = canvas.getContext("2d");

canvas.width=800;

canvas.height=600;

context.arc(100,75,50,0*Math.PI,2.5*Math.PI);

context.stroke();

context.clip();


var img = new Image();

img.src="1.jpg";


img.onload=function(){

context.drawImage(img,0,0);

context.stroke();

}

http://img.mukewang.com/56cc1146000195d008960667.jpg

提问者:慕勒6451445 2016-02-23 15:59

个回答