How to use Path predefine SVG shape in XML

In this article I have describe about a examples of Path in XML
  • 1946

Read about SVG here

Read about SVG shape here

Polygon predefine SVG shape in XML

Predefine commands are available for Path in XML

  • M = moveto
  • L = lineto
  • H = horizontal lineto
  • V = vertical lineto
  • C = curveto
  • S = smooth curveto
  • Q = quadratic Bézier curve
  • T = smooth quadratic Bézier curveto
  • A = elliptical Arc
  • Z = closepath

These commands are only use Capital Letter. These letters are show the position of path

Example

<?xml version="1.0" encoding="utf-8" ?>

<html>

  <body>

    <svg xmlns="http://www.w3.org/2000/svg" version="1.1">

      <path d="M150 10 L75 200 L225 200 Z" fill="red" />

    </svg>

  </body>

</html>

 

Output

 path image.jpg

Define the code

  • Xml define the namespace and version use the program.
  • The d defines each corner of the Path.
  • Fill is define color of path.
  • M,L is define position of path.

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.