HTML5画线、圆、矩形
">http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">>
<script><br />$(document).ready(function(){<br />var c=document.getElementById("drawbox");<br />var draw=c.getContext("2d"); //获取2d内容的引用,调用绘图API
<p>//指定渐变区块<br />var grd=draw.createLinearGradient(50,50,200,50); //坐标,长宽<br />grd.addColorStop(0,"black"); //起点颜色<br />grd.addColorStop(1,"green"); //终点颜色
<p>draw.fillStyle=grd; //设为填充样式<br />draw.fillRect(50,50,200,50); //填充进矩形内<br />})<br /></script>