Svg-ellipse

提供:Dev Guides
移動先:案内検索

SVG-楕円

<ellipse>要素は、中心点と2つの半径が指定された楕円を描画するために使用されます。

宣言

以下は、 <ellipse> 要素の構文宣言です。 主な属性のみを示しました。

<ellipse
   cx="x-axis co-ordinate"
   cy="y-axis co-ordinate"

   rx="length"
   ry="length" >
</ellipse>

属性

Sr.No. Name & Description
1 cx − x-axis co-ordinate of the center of the ellipse. Default is 0.
2 cy − y-axis co-ordinate of the center of the ellipse. Default is 0.
3 rx − x-axis radius of the ellipse.
4 ry − y-axis radius of the ellipse.

テストVG

<html>
   <title>SVG Ellipse</title>
   <body>

      <h1>Sample SVG Ellipse Image</h1>
      <svg width="800" height="800">
         <g>
            <text x="0" y="15" fill="black" >Ellipse #1: Without opacity.</text>

            <ellipse cx="100" cy="100" rx="90" ry="50"
            stroke="black" stroke-width="3" fill="rgb(121,0,121)"></ellipse>
         </g>
      </svg>

   </body>
</html>

出力

ChromeウェブブラウザでテキストSVGを開きます。 Chrome/Firefox/Operaを使用して、プラグインなしでSVG画像を直接表示できます。 Internet Explorer 9以降もSVG画像レンダリングをサポートしています。

不透明度のあるEclipse

<html>
   <title>SVG Ellipse</title>
   <body>

      <h1>Sample SVG Ellipse Image</h1>

      <svg width="800" height="800">
         <g>
            <text x="0" y="15" fill="black" >Ellipse #2: With opacity </text>

            <ellipse cx="100" cy="100" rx="90" ry="50"
            style="fill:rgb(121,0,121);stroke-width:3;
            stroke:rgb(0,0,0);stroke-opacity:0.5;opacity:0.5"></ellipse>
         </g>
      </svg>

   </body>
</html>

出力

ChromeウェブブラウザでテキストSVGを開きます。 Chrome/Firefox/Operaを使用して、プラグインなしでSVG画像を直接表示できます。 Internet Explorer 9以降もSVG画像レンダリングをサポートしています。