<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>canvas</title>
</head>
<body>
<canvas id="canvas" width="500px" height="500px;" style="border: 1px solid #000;"></canvas> <script>
window.onload = function(){
var canvas = document.getElementById('canvas');
canvas.width = 1024;
canvas.height = 768;
var cxt = canvas.getContext("2d");
cxt.moveTo(100,100);
cxt.lineTo(300,300);
cxt.lineTo(100,300);
cxt.lineTo(100,100); cxt.fillStyle = "rgb(2,100,30)";
cxt.fill(); cxt.lineWidth = 1;
cxt.strokeStyle = "red";
cxt.stroke();
cxt.closePath();
cxt.moveTo(100,400)
cxt.lineTo(400,400)
cxt.lineTo(300,400)
cxt.strokeStyle = "green";
cxt.stroke();
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>canvas</title>
</head>
<body>
<canvas id="canvas" width="500px" height="500px;" style="border: 1px solid #000;"></canvas> <script>
window.onload = function(){
var canvas = document.getElementById('canvas');
canvas.width = 1024;
canvas.height = 768;
var cxt = canvas.getContext("2d");
cxt.moveTo(100,100);
cxt.lineTo(300,300);
cxt.lineTo(100,300);
cxt.lineTo(100,100); cxt.fillStyle = "rgb(2,100,30)";
cxt.fill(); cxt.lineWidth = 1;
cxt.strokeStyle = "red";
cxt.stroke();
cxt.closePath();
cxt.moveTo(100,400)
cxt.lineTo(400,400)
cxt.lineTo(300,400)
cxt.strokeStyle = "green";
cxt.stroke();
}
</script>
</body>
</html>

最新文章

  1. UIAlertController、UIAlertAction 警告框
  2. 从客户端(?)中检测到有潜在危险的 Request.Path 值 的解决方案
  3. css浮动
  4. WPF ComboBox Binding
  5. 话说 依赖注入(DI) or 控制反转(IoC)
  6. js中的prototype和constructor
  7. JobClient学习------作业提交与初始化
  8. java socket实现全双工通信
  9. Android-----使用Button特效 selector+shape
  10. WPF柱状图(支持数据库动态更新)
  11. Java POI 导出EXCEL经典实现 Java导出Excel
  12. !!!全球最流行开源硬件平台!不知道就OUT了!
  13. 基于visual Studio2013解决C语言竞赛题之0204实数求值
  14. VC++非MFC项目中如何使用TRACE宏
  15. JSON缺包导致的错误
  16. python的with语句,超级强大
  17. 《设计模式之禅》--设计模式大PK
  18. shell脚本备份日志文件
  19. C++指针和字符串
  20. tarjan求双联通分量(割点,割边)

热门文章

  1. codeforces 688E E. The Values You Can Make(dp)
  2. C# ListView 列宽调整 刷新
  3. [九省联考2018]一双木棋chess——搜索+哈希
  4. COLORREF
  5. bzoj 5195: [Usaco2018 Feb]Directory Traversal【树形dp】
  6. Veeam对于新病毒防御的建议
  7. Luogu P1140 相似基因 【dp】By cellur925
  8. centos mysql数据库忘记密码修改
  9. BZOJ2553 [BJWC2011]禁忌
  10. 51nod 1024 矩阵中不重复的元素