Chinaunix首页 | 论坛 | 博客
  • 博客访问: 108408
  • 博文数量: 40
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 423
  • 用 户 组: 普通用户
  • 注册时间: 2013-01-15 11:55
文章分类

全部博文(40)

文章存档

2016年(36)

2015年(2)

2013年(2)

我的朋友

分类: jQuery

2016-03-25 16:20:14

在canvas中画x,代码如下

点击(此处)折叠或打开

  1. <!DOCTYPE html >
  2. <html>
  3.  <head>
  4.     <title>cars</title>
  5.     <script src=""></script>
  6.  </head>
  7.  <body>
  8.    <canvas id ="canvas" width="200" height="200"></canvas>
  9.    <script>
  10.      var canvas = document.getElementById("canvas");
  11.      var ctx = canvas.getContext("2d");
  12.     ctx.strokeStyle = "Turquoise";
  13.     ctx.lineWidth = 4;
  14.     ctx.beginPath();
  15.     ctx.moveTo(10,10);
  16.     ctx.lineTo(60,60);
  17.     ctx.moveTo(60,10);
  18.     ctx.lineTo(10,60);
  19.     ctx.stroke();
  20.    </script>
  21.  </body>
  22. </html>

阅读(692) | 评论(0) | 转发(0) |
0

上一篇:jquery canvas实例2

下一篇:jquery canvas实例4

给主人留下些什么吧!~~