截图如下:

代码如下:

 <!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基础 getattr 获取对象的指定属性值

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

  2. jQuery ajax 添加头部参数跨域

    1.添加HTTP文件头 $.ajax({ url: "http://www.baidu.com", //contentType: "text/html; charset= ...

  3. HDU 2222 Keywords Search(AC自动机模板题)

    http://acm.hdu.edu.cn/showproblem.php?pid=2222 题意:给出多个单词,最后再给出一个模式串,求在该模式串中包含了多少个单词. 思路: AC自动机的模板题. ...

  4. dev右下角增加弹框提示信息

    using System; using System.Drawing; using System.IO; using System.Threading; using System.Windows.Fo ...

  5. go 语言字典遍历

    package main import "fmt" func main() { var countryCapitalMap map[string]string /*创建集合 */ ...

  6. shell 布尔运算

    布尔运算 Bash 里的逻辑运算,与.或.非. 在 Shell 下如何进行逻辑运算 范例:true or false 单独测试 true 和 false,可以看出 true 是真值,false 为假 ...

  7. 【转】QT获取系统时间,以及设置日期格式

    http://blog.csdn.net/zzk197/article/details/7498593 例如我要在一个label上设置当前时间 QDateTime time = QDateTime:: ...

  8. spring-cloud: eureka之:ribbon负载均衡自定义配置(二)

    spring-cloud: eureka之:ribbon负载均衡自定义配置(二) 有默认配置的话基本上就是轮询接口,现在我们改用自定义配置,同时支持:轮询,随机接口读取 准备工作: 1.eureka服 ...

  9. Win7 默认.lnk打开方式全是别的程序 还原的办法

    Xu言: no zuo no die~ 今天,一个朋友问我,他电脑桌面上点任何东西都是提示下载... - -||| 本以为是中毒了,然后上去看了一眼..发现他自己把所有.lnk 的默认打开方式选择了搜 ...

  10. Android Studio 常用快捷键和使用技巧

    Android Studio 1.Ctrl+E,可以显示最近编辑的文件列表 2.Shift+Click可以关闭文件 3.Ctrl+[或]可以跳到大括号的开头结尾 4.Ctrl+Shift+Backsp ...