html5画四边形

<canvas id='test02'></canvas>

<script>
var canvas = document.getElementById('test02');
var context = canvas.getContext('2d');

context.moveTo(50, 0);  
context.lineTo(0, 50); 
context.lineTo(50, 100); 
context.lineTo(100, 50); 
context.lineTo(50, 0); 

context.stroke();
</script>

  

posted @ 2015-07-24 16:21  Adtuu  阅读(668)  评论(0编辑  收藏  举报