HTML5画布变形
如果画布看起来变形,请尝试更改高度和宽度-
<canvas id = ”canvas1” width = '400' height = '300'></canvas>
HTML5中画布的默认高度和宽度为2/1比率-
width = 300height = 150
示例
让我们看一个例子-
<!DOCTYPE HTML><html>
<head>
<style>
#mycanvas{border:1px solid red;}
</style>
</head>
<body>
<canvas id = "mycanvas" width = "100" height = "100"></canvas>
</body>
</html>
以上是 HTML5画布变形 的全部内容, 来源链接: utcz.com/z/347359.html