赞
踩
- <!DOCTYPE html>
- <html lang="en">
-
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- <style>
- canvas {
- border: 1px solid red
- }
- </style>
- </head>
-
- <body>
- <!-- 修改画布得尺寸 -->
- <canvas width="800" height="600">我是歌谣</canvas>
- <script>
- //获取元素
- var cans = document.querySelector('canvas');
- //获取向下对象
- var ctx = cans.getContext('2d')
- //指定画布得坐标
- ctx.moveTo(100, 100);
- //指定终点
- ctx.lineTo(300, 1
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。