截图如下:

代码如下:

 <!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. 牛客网试卷: 京东2019校招笔试Java开发工程师笔试题(1-)

    1.在软件开发过程中,我们可以采用不同的过程模型,下列有关 增量模型描述正确的是() A 是一种线性开发模型,具有不可回溯性 B 把待开发的软件系统模块化,将每个模块作为一个增量组件,从而分批次地分析 ...

  2. C# 获取枚举的描述属性

    在使用枚举类型时,我们需要取名称和值,甚至有时候还需要取枚举类型的描述.通过反射,我们能获取到枚举类型的描述属性. 首先我们需要给枚举类型添加描述属性(属性都没有是不可能取到的),[Descripti ...

  3. 【angular2+typeScript+ng-zorro】Carousel 走马灯的左右方向控件实现

    ng-zorro Carousel 走马灯的左右方向控件实现 ng-zorro框架的走马灯本身还没有左右方向控件的实现,作者只是在文档中(0.6x)中曝出几个方法接口,如图: 实现: 在根compon ...

  4. 面向对象之(非)绑定方法,反射,isinstance与issubclass

    isinstance(obj,cls)和issubclass(sub,super) isinstance(obj,cls)检查obj是否是类 cls 的对象 class Foo(object): pa ...

  5. cygwin下使用apt-cyg安装新软件

    1.获取  (记得先安装好git) git clone https://github.com/transcode-open/apt-cyg.git 2.安装apt-cyg cd apt-cyg chm ...

  6. C# 给某个方法设定执行超时时间

    ManualResetEvent.WaitOne 方法 https://msdn.microsoft.com/en-us/library/system.threading.manualreseteve ...

  7. 51NOD 1057 N的阶乘

    1057 N的阶乘 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题   输入N求N的阶乘的准确值.   Input 输入N(1 <= N <= 10000) ...

  8. [bzoj 1774][Usaco2009 Dec]Toll 过路费

    题目描述 跟所有人一样,农夫约翰以着宁教我负天下牛,休叫天下牛负我的伟大精神,日日夜夜苦思生 财之道.为了发财,他设置了一系列的规章制度,使得任何一只奶牛在农场中的道路行走,都 要向农夫约翰上交过路费 ...

  9. layer.alert自定义关闭回调事件

    在项目应用中,遇到自定义关闭layer.alert弹出层,即在关闭layer.alert时,可以自动触发关闭时的事件, 具体方法为: layer.alert('爱心提示!', function(){ ...

  10. darknet-训练自己的yolov3模型

    目录 Yolo v3的使用方法 安装darknet 训练Pascal VOC格式的数据 修改cfg文件中的voc.data 修改VOC.names 下载预训练卷积层权重 修改cfg/yolov3-vo ...