Hi

I'm new to batik and tried to do use the JSVGCanvas with an SVGGraphics2D 
object - that basically worked - but than I tried to scale it via an Affine 
Transformation ... that fails sometimes. It only fails when the area that I 
paint on with SVGGraphics is bigger than the JSVGCanvas size, but it does not 
always fail ... sometimes I just run it again it works ...

I am running a Linux (Gentoo) with a 1.5.0_09-b03 Java Version, developing in 
Eclipse 3.2 and using Batik 1.6.

Here is the sourcecode I use:

        public static void main(String[] args) {
                // TODO Auto-generated method stub
                JFrame frame = new JFrame("test");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setSize(500, 500);
                JSVGCanvas canvas = new JSVGCanvas();
                frame.getContentPane().add(canvas);
                String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
                // Get a DOMImplementation
        DOMImplementation domImpl =
            GenericDOMImplementation.getDOMImplementation();

        // Create an instance of org.w3c.dom.Document
        Document document = domImpl.createDocument(svgNS, "svg", null);

        // Create an instance of the SVG Generator
        SVGGraphics2D g = new SVGGraphics2D(document);
        //some stupid drawings for testing
        g.setColor(Color.green);
        g.fillRect(0, 0, 1501, 1501);
        g.setColor(Color.black);
        g.drawRect(10, 10, 100, 100);        
        g.setColor(java.awt.Color.red);
        g.fillArc(20, 20, 50, 50, 0, 359);
        
        Element root = document.getDocumentElement();
        g.getRoot(root);
       
        canvas.setDocument(document);
        
        frame.setVisible(true);
        
        canvas.setRenderingTransform(AffineTransform.getScaleInstance(0.1, 
0.1), true);
        }

Since I am new ... did I use the batik api wrong or is there somewhere a bug?

cu & thx
ernii
-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to