xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eilein Grasp <blackm...@digiverse.net>
Subject Setting Opacity
Date Mon, 01 Nov 2004 04:39:09 GMT
<html><body><span style="font-family: arial,helvetica,sans-serif;"><font
size="2">I'm
trying to vary the opactity of SVGElements with .setAttribute() and
while it works fine with "opacity" on some elements, on others only
"fill-opacity" seems to work -- but I can't see the pattern. I don't
think it has to do with grouping. I'd like to use "opacity" for all
elements.<br>
<br>
Also I've tried setting the opacity of SVGElements using computed style:<br>
<br>
private void setCSSOpacity(float o)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // we get NPEs here for some
elements<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CSSOMValue ov =
(CSSOMValue)((ViewCSS)svg.getDocumentElement()).getComputedStyle(element,
null).getPropertyCSSValue("opacity");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Logger.getLogger("debug").info("Opacity
CSS:"+ov);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // this creates a DOMException<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ov.setFloatValue(CSSPrimitiveValue.CSS_NUMBER,
o);<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
but I get a DOMException on trying to set the value of the computed CSS opacity.<br>
<br>
<br>
</font></span><br>&nbsp;<br><hr>yourname@digiverse.net
<br>http://www.digiverse.net<br></body></html>

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message