zoukankan      html  css  js  c++  java
  • svg学习(五)ellipse

    <ellipse> 标签

    <ellipse> 标签可用来创建椭圆。椭圆与圆很相似。不同之处在于椭圆有不同的 x 和 y 半径,而圆的 x 和 y 半径是相同的。

    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    
    <svg width="100%" height="100%" version="1.1"
    xmlns="http://www.w3.org/2000/svg">
    
    <ellipse cx="300" cy="150" rx="200" ry="80"
    style="fill:rgb(200,100,50);
    stroke:rgb(0,0,100);stroke-2"/>
    
    </svg>

    代码解释:

    • cx 属性定义圆点的 x 坐标
    • cy 属性定义圆点的 y 坐标
    • rx 属性定义水平半径
    • ry 属性定义垂直半径

    下面的例子创建了三个累叠而上的椭圆:

    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    
    <svg width="100%" height="100%" version="1.1"
    xmlns="http://www.w3.org/2000/svg">
    
    <ellipse cx="240" cy="100" rx="220" ry="30"
    style="fill:purple"/>
    
    <ellipse cx="220" cy="70" rx="190" ry="20"
    style="fill:lime"/>
    
    <ellipse cx="210" cy="45" rx="170" ry="15"
    style="fill:yellow"/>
    
    </svg>

    下面的例子组合了两个椭圆(一个黄的和一个白的):

    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    
    <svg width="100%" height="100%" version="1.1"
    xmlns="http://www.w3.org/2000/svg">
    
    <ellipse cx="240" cy="100" rx="220" ry="30"
    style="fill:yellow"/>
    
    <ellipse cx="220" cy="100" rx="190" ry="20"
    style="fill:white"/>
    
    </svg>
  • 相关阅读:
    远程获取图片尺寸
    python httplib get和post获取数据
    python 之 logging
    php artisan常用方法
    html页面制作css基本设置
    zlib-1.2.7/libpng-1.5.9 instead of zlib-1.2.8/libpng-1.6.6
    shell脚本自动拉起启动程序
    php截取中文无乱码
    路飞学城1之课程与课程详细
    vuex(数据商店实现思想)day06
  • 原文地址:https://www.cnblogs.com/aomi/p/3538066.html
Copyright © 2011-2022 走看看