截图如下:

代码如下:

 <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Drawing house</title>
</head>
<body>
<canvas id="myCanvas" width="650" height="550" style="border:1px solid"></canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.fillStyle = "#9FFFFFFF";
ctx.fillRect(25,275,600,250); // Draw triangle
ctx.fillStyle="#FFFFDBFF";
ctx.beginPath();
ctx.moveTo(325,25);
ctx.lineTo(25,275);
ctx.lineTo(635,275);
ctx.closePath();
ctx.fill(); //windows
ctx.fillStyle="#FF7FEDFF";
ctx.fillRect(50,400,200,100);
ctx.fillStyle="#FFD800FF";
ctx.fillRect(52,402,96,46);
ctx.fillRect(152,402,96,46);
ctx.fillRect(52,452,96,46);
ctx.fillRect(152,452,96,46); //door
ctx.fillStyle = "#754719";
ctx.fillRect(300,375,100,150); //door knob
ctx.beginPath();
ctx.fillStyle = "#F2F2F2";
ctx.arc(325,400,3,0,2*Math.PI);
ctx.fill();
ctx.closePath(); //Text on the Right
ctx.font="40px Veranda";
ctx.fillText("Hello",425,350);
ctx.font="30px Veranda";
ctx.fillText("LiuWei",425,390);
ctx.fillText("Canvas",425,420);
</script>
</body>
</html>

Drawing house的更多相关文章

  1. .Net Core上用于代替System.Drawing的类库

    目前.Net Core上没有System.Drawing这个类库,想要在.Net Core上处理图片得另辟蹊径. 微软给出了将来取代System.Drawing的方案,偏向于使用一个单独的服务端进行各 ...

  2. 关于Cewu Lu等的《Combining Sketch and Tone for Pencil Drawing Production》一文铅笔画算法的理解和笔录。

     相关论文的链接:Combining Sketch and Tone for Pencil Drawing Production 第一次看<Combining Sketch and Tone f ...

  3. (转)System.Drawing.Color的颜色对照表

    经常使用System.Drawing.Color, 本篇介绍一下颜色与名称及RGB值的对应关系. 1. 颜色与名称的对照表(点击下图放大看): 2. 颜色与RGB值对照表: Color.AliceBl ...

  4. .Net Core 之 图形验证码 本文介绍.Net Core下用第三方ZKWeb.System.Drawing实现验证码功能。

    本文介绍.Net Core下用第三方ZKWeb.System.Drawing实现验证码功能. 通过测试的系统: Windows 8.1 64bit Ubuntu Server 16.04 LTS 64 ...

  5. System.Drawing.Color

    System.Drawing.Color color=Color.Red; System.Drawing.Color color=Color.FromArgb(,,); System.Drawing. ...

  6. drawing

    /* 程序名:drawing..c 功能:展示OpenCV的图像绘制功能 */ #include "cv.h" #include "highgui.h" #in ...

  7. 使用System.Drawing.Imaging.dll进行图片的合并

    在最近开发项目的时候有时候需要进行图片的合并,即将两张图片合并成功一张图片 合并图片的代码: #region 两张图片的合并 /// <summary > /// 将Image对象转化成二 ...

  8. [OpenCV] Samples 01: drawing

    基本的几何图形,标注功能. commondLineParser的使用参见:http://blog.csdn.net/u010305560/article/details/8941365 #includ ...

  9. [emacs] Drawing uml under emacs org-mode using plantUML - 类图

    [emacs] Drawing uml under emacs org-mode using plantUML - 类图 // */ // ]]>   [emacs] Drawing uml u ...

  10. SVG Drawing Animation - SVG 绘制动画

    一个小实验,探索 SVG 线图动画的使用情况,以前沿的展示形式呈现图形或网站元素的外观,模拟它们的加载.SVG 真的很强大,有许多创造性和可能性,使用 SVG 可以制作各种有趣的网站交互效果.今天这篇 ...

随机推荐

  1. Python3基础 tuple 通过拆分元素 把元组的数据删除

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  2. 51NOD 1046 A^B Mod C

    给出3个正整数A B C,求A^B Mod C. 例如,3 5 8,3^5 Mod 8 = 3. Input 3个正整数A B C,中间用空格分隔.(1 <= A,B,C <= 10^9) ...

  3. 3G下的无压缩视频传输(基于嵌入式linux) (转载)

    本课题研究嵌入式系统在数据采集,3G无线通信方面的应用,开发集视频采集.地理信息采集.无线传输.客户机/服务器模式于一体的车载终端,实现终端采集视频与GPS信息的传输,支持服务器端显示视频与GPS信息 ...

  4. NS3 使用NS3工具PyViz

    官方文档 跑了一个样例(first.py): 由于 NetAnim 对我实在是有点不友好,在 PyViz 和 NetAnim 之间,我倾向前者.后者需要生成.xml文件,相比前者较为麻烦. 安装过程: ...

  5. IDEA启动时自动报Plugin Error错误

    Plugin Error Problems found loading plugins: Plugin "JBoss Integration" was not loaded: re ...

  6. python PIL 图像处理库简介(一)

    1. Introduction     PIL(Python Image Library)是python的第三方图像处理库,但是由于其强大的功能与众多的使用人数,几乎已经被认为是python官方图像处 ...

  7. Remastersys -- 将正在使用的Ubuntu14.04 制作成镜像文件

    remastersys 是一个能够备份你的ubuntu系统的工具. 源码在github上能找到:Remastersys Source 另外系统是 Ubuntu14.04/12.04 也可以直接 apt ...

  8. c++ 静态函数

    //对象与对象之间的成员变量是相互独立的.要想共用数据,则需要使用静态成员或静态方法 //#只要在类中声明静态成员变量,即使不定义对象,也可以为静态成员变量分配空间,进而可以使用静态成员变量.(因为静 ...

  9. c++ 容器元素遍历打印(for_each)

    #include <iostream> // cout #include <algorithm> // for_each #include <vector> // ...

  10. c++ 在指定长度的数组或者容器中,统计元素出现的次数(count)

    #include <iostream> // cout #include <algorithm> // count #include <vector> // vec ...