html5 canvas 線太粗的解決方法
<script>
mycanvas=document.getElementById("mycanvas");
ctx = mycanvas.getContext("2d");
ctx.translate(0.5,0.5); //html5 canvas 線太粗的解決方法
//畫矩形
ctx.beginPath(); //這行必須有,不然看不到效果
ctx.lineWidth = 1;
ctx.strokeRect(100,100,200,200);
ctx.closePath();
</script>
mycanvas=document.getElementById("mycanvas");
ctx = mycanvas.getContext("2d");
ctx.translate(0.5,0.5); //html5 canvas 線太粗的解決方法
//畫矩形
ctx.beginPath(); //這行必須有,不然看不到效果
ctx.lineWidth = 1;
ctx.strokeRect(100,100,200,200);
ctx.closePath();
</script>
中國· 上海

添加微信咨詢
關(guān)鍵詞
辦公室:上海市浦東新區(qū)郭守敬路351號(hào)
CopyRight?2009-2019 上海谷谷網(wǎng)絡(luò)科技有限公司 All Rights Reserved. 滬ICP備11022482號(hào)-8
- top
- 在線咨詢
-
添加微信咨詢