<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>太极图</title>
</head>
<body>
<canvas id="myCanvas" width="1300px" height="600px" style="background:gray">
你的浏览器不支持canvas
</canvas>
<script type="text/javascript">
var canvas=document.getElementById('myCanvas');
var context=canvas.getContext('2d'); // 太极图
context.lineWidth=5;
context.fillStyle="black";
context.arc(400,300,200,Math.PI/2,Math.PI/2*3,false);
context.fill(); context.beginPath();
context.fillStyle="white";
context.arc(400,300,200,Math.PI/2*3,Math.PI/2,false);
context.fill(); context.beginPath();
context.fillStyle="black";
context.arc(400,200,100,Math.PI/2*3,Math.PI/2,false);
context.fill(); context.beginPath();
context.fillStyle="white";
context.arc(400,400,100,Math.PI/2,Math.PI/2*3,false);
context.fill(); // 两个小圆心
context.beginPath();
context.fillStyle="white";
context.arc(400,200,10,0,Math.PI*2,false);
context.fill(); context.beginPath();
context.fillStyle="black";
context.arc(400,400,10,0,Math.PI*2,false);
context.fill(); </script>
</body>
</html>

1.利用canvas画一个太极图的更多相关文章

  1. 10分钟,利用canvas画一个小的loading界面

    首先利用定义下canvas得样式 <canvas width="1024" height="720" id="canvas" styl ...

  2. 利用canvas画一个实时时钟

    先放一张效果图: 下面是源代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"& ...

  3. Android利用canvas画各种图形

    Android利用canvas画各种图形(点.直线.弧.圆.椭圆.文字.矩形.多边形.曲线.圆角矩形) 本文链接:https://blog.csdn.net/rhljiayou/article/det ...

  4. 深夜,用canvas画一个时钟

    深夜,用canvas画一个时钟 查看demo 这几天准备阿里巴巴的笔试,可以说已经是心力交瘁,自从阿里和蘑菇街的内推被刷掉之后,开始越来越怀疑起自己的能力来,虽然这点打击应该是微不足道的.毕竟校招在刚 ...

  5. 用Canvas画一个刮刮乐

    Canvas 通过 JavaScript 来绘制 2D图形.Canvas 是逐像素进行渲染的.开发者可以通过javascript脚本实现任意绘图.Canvas元素是HTML5的一部分,允许脚本语言动态 ...

  6. 用canvas画一个的小画板(PC端移动端都能用)

    前言 本篇的内容主要包括: canvas标签简介 画板的功能简介 画板的JS部分(包括:1.获取画布 2.使画板全屏幕显示且自适应 3.如何绘制直线 4.绘画时的三种状态(鼠标点击.移动.离开)5.画 ...

  7. Android利用canvas画各种图形(点、直线、弧、圆、椭圆、文字、矩形、多边形、曲线、圆角矩形) .

    1.首先说一下canvas类: Class Overview The Canvas class holds the "draw" calls. To draw something, ...

  8. Android利用canvas画各种图形 及Paint用法 .

    引自:http://blog.csdn.net/carlfan/article/details/8139984 1.首先说一下canvas类: Class Overview The Canvas cl ...

  9. 使用H5 canvas画一个坦克

      具体步骤如下:   1. 首先做出绘图区,作为坦克的战场   <canvas id="floor" width="800px" height=&quo ...

随机推荐

  1. adaptiveThreshold(自适应阈值)

    void adaptiveThreshold(InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thr ...

  2. nginx typecho config

    ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx confi ...

  3. WebView:是应用程序打开web网页的UI控件前台

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools= ...

  4. springboot 基于@Scheduled注解 实现定时任务

    前言 使用SpringBoot创建定时任务非常简单,目前主要有以下三种创建方式: 一.基于注解(@Scheduled) 二.基于接口(SchedulingConfigurer) 前者相信大家都很熟悉, ...

  5. python之正则匹配match:search findall

    match:从开头位置匹配,只匹配一次,开头匹配不上,则不继续匹配 a,b,\w+ match(a,"abcdef") 匹配a >>> re.match(&quo ...

  6. php中处理汉字字符串长度:strlen和mb_strlen

    PHP内置的字符串长度函数strlen()无法正确处理中文字符串,它得到的只是字符串所占的字节数.对于GB2312的中文编码,strlen得到的值是汉字个数的2倍,而对于UTF-8编码的中文,就是3倍 ...

  7. linux上的常用的系统自带命令

    wikipedia 发现的分类,发现还有好多没用过.. Unix command-line interface programs and shell builtins   File system ca ...

  8. VS2012下std::function的BUG解决办法

    VS2012版本下std::function存在问题,链接:https://stackoverflow.com/questions/13096162/stdfunction-not-compiling ...

  9. 用户tokenId

    tokenId表示为:用户登录到成功后,服务端分配给客户端的令牌号,同时下发tokenId的过期时间.下次用户直接持有tokenId,在其过期时间内均可跳过用户登录步骤,直接请求其他服务操作.如果to ...

  10. JavaScript对象之--- RegExp

    1.概述 正则表达式是描述字符模式的对象. 正则表达式用于对字符串模式匹配以及检索替换: 2.语法 前者为模式,后者为修饰符. var reg = new RegExp( "xyz" ...