• 当前标签:canvas画板

canvas简易画板

路径移动部分代码: canvas.onmousedown = function(ev){ ev = ev || window.event; _x = ev.clientX , _y = ev.clientY; // 路径开始 cxt.beginPath(); cxt.moveTo(_x - canvas.offsetLeft , _y - canvas.offsetTop); this.onmousemove = function(ev){ ev = ev || window.event; x = ev.clientX , y = ev.clientY; // 路径移动 cxt.lineTo(

2016-10-24 22:31:51 3350 12 22
阅读详情
  • 1
前往