xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Generate a GeneralPath and draw it
Date Wed, 02 Apr 2008 10:48:48 GMT
Frantch <le_maitre@bluewin.ch> wrote on 03/27/2008 06:40:28 PM:

> I'am trying to convert a SVG <path...> in a GeneralPath
>
> I have found this methode
>  shape = AWTPathProducer.createShape("the path balise id=..",
> GeneralPath.WIND_EVEN_ODD);
>
> but i don't know, how i can use it?? how i can have a GeneralPath for my
> shape?

   Element e = document.getElementById("your-id");
   Shape s = AWTPatProducer.createShape(StringReader(e.getAttributeNS(null,
"d"))),
                                        GeneralPath.WIND_EVEN_ODD);

   The returned shape is (I think) normally a GeneralPath, but all you
should really care about is being able to get the PathIterator from the
Shape.
Mime
View raw message