>>>>> "MM" == Mark Macbeth <[EMAIL PROTECTED]> writes:

MM> Thank you very much.  I will look into everything.  This all
MM> sounds very valuable to the official list.

    Thanks...

-----Original Message-----
From: Thomas E Deweese [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 09, 2002 4:37 PM
To: Mark Macbeth
Cc: [EMAIL PROTECTED]
Subject: RE: incomplete rastorization?

>>>>> "MM" == Mark Macbeth <[EMAIL PROTECTED]> writes:

MM> I hope you don't mind me replying off the list...  

    I would like to forward the response to the batik-list (I can omit
the svg and png if desired).

MM> I've attached two smallish files: my SVG source, and the png
MM> result produced by the Rasterizer.  The png was generated using:

    You  have a number of problems here :)

    The first problem is that you have not turned off double buffering
in your Swing component so all the SVGGraphics2D captured was an image
(note the only thing in the SVG file is the rather large image
element).  This is ok for the default viewing but if you zoom in
things will get pixelated - Uggg! :/

    See javax.swing.JComponent.setDoubleBuffered(boolean aFlag).

    Second the outermost svg element has no viewBox attribute.  This
is what causes your image to get truncated when rasterizing.  This can
be fixed by adding the viewBox attribute (there may be a bug in the
'-a' option to the rasterizer - as your image continues to be
truncated even when specified - which I don't think it should).

    Third the outermost svg element has no width and height, this is
why the output image is always 400x400.

    Both the viewBox and width and height attributes can be set by
calling 'SVGGraphics2D.setSVGCanvasSize(Dimension size)'.

    Fourth and finally you also have a clippath although the bounds
for that seems to allow for most of the 'image' to be shown.  This is
probably also coming from the swing component, so I would be careful
that if you want the entire graph to be put in the SVG document and
not all of it is visible in the swing component you don't end up with
a clippath that hides the stuff outside of the part visible in swing.

MM> % java -Xmx128m org.apache.batik.apps.rasterizer.Main -m image/png
MM> test.svg

MM> Messing with the Rasterizer's command line arguments only seems to
MM> make things worse...

MM> If you can spot anything obvious it would be greatly appreciated.

    I hope the above helps some...



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

Reply via email to