xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject Using transparency over an underlying component
Date Tue, 12 Mar 2002 22:19:29 GMT
>>>>> "TW" == Todd Wilson <todd_wilson@byu.edu> writes:

TW> Transparency within an SVG seems to work just fine, meaning shapes
TW> overlaying each other where "fill:none" can be designated in order
TW> to allow some shapes visible through other shapes.  However, we're
TW> hoping to accomplish basically what a transparent GIF
TW> allows--portions of an image are transparent and allow whatever
TW> the SVG is rendred on top of to show through the image.  So, for
TW> example, I could render an SVG on top of a JFrame or JPanel that
TW> has a blue background, and portions of that blue background would
TW> be visible through the SVG because portions of the SVG are
TW> transparent.

    You need to set the background of the JSVGCanvas to something
other than white.  I suggest transparent black:

     // Make sure that the canvas isn't opaque.
+    svgCanvas.setBackground(new Color(0,0,0,0));
     svgCanvas.setOpaque( false );
     System.out.println( "isOpaque: " + svgCanvas.isOpaque() );

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

View raw message