|
img.style.display=''none''; canvas=document.createElement(''canvas''); canvas.setAttribute(''id'',''pic_''+pid); img.parentNode.appendChild(canvas); } //旋转角度以弧度值为参数 vardegree=step90Math.PI/180; varctx=canvas.getContext(''2d''); switch(step){ case0:www.jds567.com金德胜棋牌官网 canvas.width=width; canvas.height=height; ctx.drawImage(img,0,0); break; case1: canvas.width=height; canvas.height=width; ctx.rotate(degree); ctx.drawImage(img,0,-height); break; case2:www.jds006.com金德胜捕鱼平台 canvas.width=width; canvas.height=height; ctx.rotate(degree); ctx.drawImage(img,-width,-height); break; case3: canvas.width=height; canvas.height=width; ctx.rotate(degree); ctx.drawImage(img,-width,0); break; } }
| | |