HTML5画布非常长的行在其他浏览器中被剪切

时间:2017-01-31 16:42:00

标签: html html5 canvas html5-canvas

我在html中有这些特定的代码,但问题是我绘制的行是在firefox和Internet Explorer中剪切的。

这是我的示例html。

<!DOCTYPE html>
<html>
<body>

<canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>

<script>
var c = document.getElementById("myCanvas");
c.setAttribute("width", "10000");
var ctx = c.getContext("2d");
ctx.moveTo(1,10);
ctx.lineTo(10000,10);
ctx.stroke();
</script>

</body>
</html>

0 个答案:

没有答案