截图如下:

代码如下:

 <!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. VC++禁止标题栏鼠标双击事件

    转载:http://blog.sina.com.cn/s/blog_4ad042e50102dwv0.html 重载DefWindowProc,在里面截获WM_NCLBUTTONDBLCLK消息进行处 ...

  2. TeeChart缩放

    //缩放的技巧 //首先找到待缩放的区域,例如横轴x1-x2,纵轴y1-y2 //那么待放到的区域就是x=x1;x=x2;y=y1;y=y2;这四条线组成的矩形 //首先确定矩形的左上角的坐标,然后确 ...

  3. hdu 3415 Max Sum of Max-K-sub-sequence 单调队列优化DP

    题目链接: https://www.cnblogs.com/Draymonder/p/9536681.html 同上一篇文章,只是 需要记录最大值的开始和结束的位置 #include <iost ...

  4. EasyUI ---- draggable购物车

    @{ ViewBag.Title = "Easyui_draggable"; Layout = "~/Views/Shared/Layouts.cshtml"; ...

  5. MVC ---- EF批处理

    #region 批处理 ///<summary> ///两增一删一改 ///</summary> public void Save(){ //新增参一 Parameter pa ...

  6. LINUX设备驱动模型之class

    转自 https://blog.csdn.net/qq_20678703/article/details/52754661 1.LINUX设备驱动模型中的bus.device.driver,.其中bu ...

  7. hdu 5651 xiaoxin juju needs help 逆元 两种求解方式

    xiaoxin juju needs help Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/ ...

  8. c++ 查找容器中符合条件的元素,并返回iterator(find_if)

    #include <iostream> // std::cout #include <algorithm> // std::find_if #include <vecto ...

  9. HTML元素1: 基本元素,标题,段落,链接,图像等

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  10. Python day10 global关键字、函数递归、匿名函数、map函数的用法详解

    1.global关键字 引用全局变量,在局部全局变量改变,也会改变,global相当于指针,将地址指向全局变量的name name='littlepage' def littepage(): glob ...