ZVON > References > Zvon Example Repository
Example repository: index | categories | search

All > SVG > Masking > masking-mask-BE-05


File: masking-mask-BE-05
Author: Haroon Sheikh
Origin: W3C SVG conformance suite

Rendered imageSVG source
ElementsAttributes
axlink:href |
defs
descid |
gid | style |
linearGradientgradientUnits | id | x1 | x2 | y1 | y2 |
maskheight | id | maskUnits | width | x | y |
pathd | style |
rectheight | id | style | width | x | y |
stopoffset | style |
svgheight | id | width |
textstyle | x | y |
titleid |

Source

<svg id="masking-mask-BE-05" width="450" height="450" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" >
     <title id="test-title">masking-mask-BE-05</title>
     <desc id="test-desc"> Test to see if the masking features using the mask element and mask property are available. </desc>
     <g id="test-body-content">
          <text style="font-family:Helvetica;font-size:14;" x="10" y="20">Test for mask support</text>
          <rect x="10" y="30" width="100" height="340" style="fill:red;"/>
          <mask id="mask1" maskUnits="userSpaceOnUse" x="60" y="50" width="100" height="60">
               <defs>
                    <linearGradient gradientUnits="userSpaceOnUse" id="Grad1" x1="60" y1="50" x2="60" y2="120">
                         <stop style="stop-color:white;stop-opacity:1;" offset="0"/>
                         <stop style="stop-color:white;stop-opacity:0.5;" offset="1"/>
                    </linearGradient>
               </defs>
               <rect x="60" y="50" width="100" height="60" style="fill:url(#Grad1);"/>
          </mask>
          <rect x="60" y="50" width="100" height="60" style="fill:lime;mask:url(#mask1);"/>
          <text style="font-family:Helvetica;font-size:12;" x="200" y="65">Mask with linear gradient from</text>
          <text style="font-family:Helvetica;font-size:12;" x="200" y="80">opacity=1 to opactity=0.5</text>
          <mask id="mask2" maskUnits="userSpaceOnUse" x="60" y="130" width="100" height="40">
               <rect x="60" y="130" width="100" height="40" style="fill-opacity:0.5;fill:white;"/>
          </mask>
          <rect x="60" y="130" width="100" height="40" style="fill:lime;mask:url(#mask2);"/>
          <text style="font-family:Helvetica;font-size:12;" x="200" y="145">Mask with uniform opacity of 0.5</text>
          <rect x="60" y="180" width="100" height="40" style="fill:lime;fill-opacity:0.5;"/>
          <text style="font-family:Helvetica;font-size:12;" x="200" y="195">Rectangle with uniform opacity of 0.5</text>
          <mask id="mask3" maskUnits="userSpaceOnUse" x="60" y="260" width="200" height="100">
               <rect x="60" y="260" width="200" height="25" style="fill:white;fill-opacity:0.5;"/>
               <rect x="60" y="285" width="200" height="25" style="fill:white;fill-opacity:0.2;"/>
               <rect x="60" y="310" width="200" height="25" style="fill:white;fill-opacity:1;"/>
               <rect x="60" y="335" width="200" height="25" style="fill:white;fill-opacity:0.7;"/>
          </mask>
          <text x="60" y="340" style="font-family:Helvetica;font-size:100;fill:lime;mask:url(#mask3);">BCD</text>
          <text style="font-family:Helvetica;font-size:12;" x="200" y="285">Text with mask containing rectangles</text>
          <text style="font-family:Helvetica;font-size:12;" x="200" y="300">of various opacities</text>
     </g>
     <g id="test-legend" style="fill:black;font-family:Helvetica;font-size:10;">
          <rect x="10" y="390" width="275" height="50" style="fill:none;stroke:#000000;"/>
          <path style="fill:none;stroke:#000000;" d="M10 405 h275 M205 405 v35 M10 426 h195 M205 422 h80"/>
          <text x="25" y="401">Scalable Vector Graphics (SVG) Conformance Suite</text>
          <a xlink:href="copyright-documents-19990405.html">
               <text x="12" y="437" style="fill:blue;">Copyright 2000 W3C. All Rights Reserved.</text>
          </a>
          <text style="font-size:12;" x="35" y="420">masking-mask-BE-05</text>
          <text style="font-size:10;" x="210" y="417">$Revision: 1.1 $</text>
          <text style="font-size:10;" x="210" y="435">Release 2.0</text>
          <rect id="test-frame" x="1" y="1" width="448" height="448" style="fill:none;stroke:#000000;"/>
     </g>
</svg>



Sponsored links: conference call service, VoIP Internettelefonie, DSL, SDSL, ADSL, answering service