How to create Radial in XML

In this article I have describe about example of Radial in XML.
  • 2012

Read about SVG here

Create a radial in SVG

The <radialGradient> element is defining radial gradient, it is use <defs> element in gradient in SVG.

Radial is require id attributes.

Define <radialGradient> in a circle.

Example

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

 <html>

  <body>

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

      <defs>

        <radialGradient id="grad1" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">

          <stop offset="0%" style="stop-color:rgb(255,255,255);

      stop-opacity:0" />

          <stop offset="100%" style="stop-color:rgb(255,o,o);stop-opacity:1" />

        </radialGradient>

      </defs>

      <circle cx="200" cy="50" r="30" fill="url(#grad1)" />

    </svg>

   </body>

  </html>

 

Output

 radial.jpg

Define the code

  • XML define the namespace and version use the program.
  • <radialGradient> is define the radial in a circle
  • stop process is define range of radian
  • <circle> is create a circle shape and style is show the color of the circle.
  • The <circle> element links the element to the (#grad1)

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

© 2020 DotNetHeaven. All rights reserved.