Using Multiple SVG scale Elements : transform « SVG « XML






Using Multiple SVG scale Elements

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"
 "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg width="800" height="500">
  <defs>
    <pattern id="checkerPattern" width="80" height="80"
      patternUnits="userSpaceOnUse">

      <rect fill="red" x="0" y="0" width="40" height="40" />

      <rect fill="blue" x="0" y="40" width="40" height="40" />

    </pattern>
  </defs>

  <g transform="translate(50,50)">
    <g transform="scale(1)">
      <rect fill="url(#checkerPattern)" style="stroke:white" x="0"
        y="0" width="320" height="320">
      </rect>
    </g>
  </g>

  <g transform="translate(50,50)">
    <g transform="scale(.6)">
      <rect fill="url(#checkerPattern)" style="stroke:white" x="0"
        y="0" width="320" height="320">
      </rect>
    </g>
  </g>

  <g transform="translate(50,50)">
    <g transform="scale(.2)">
      <rect fill="url(#checkerPattern)" style="stroke:white" x="0"
        y="0" width="320" height="320">
      </rect>
    </g>
  </g>
</svg>

 








Related examples in the same category

1.transform the coordinate
2.Using the SVG scale Function with Checkerboards
3.Transform circle