xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thierry Kormann <tkorm...@ilog.fr>
Subject Re: pixels vs. pt in JSVGComponent
Date Wed, 11 Jul 2001 13:09:57 GMT
On Tuesday 10 July 2001 02:49, Peter Armstrong wrote:
> Hi all,
>
> I'm using a JSVGComponent in my Swing application and when the SVG document
> it is based on uses pixels, such as the following:
> ...
> But this is where I'm stuck.  Has anyone had similar problems?  This might
> has something to do with the SVGUserAgent.  I tried passing in null to get
> the default one, and I tried writing my own (whose getPixelToMM() method
> returned 0.26458333333333333333333333333333f), and in both cases I get the
> same exception.  I have also looked through some of the Batik sources but I
> can't figure out what it is that they do that I need to do to be able to
> handle point measurements correctly but I haven't found it.

To handle units you have the UnitProcessor class in the bridge package.
This class provides methods used everywhere in the bridge (see 
SVGSVGElementBridge...) such as float svgLengthToUserSpace(...).

If you just want to size of the document, you can ask to the bridge context 
to give that size in pixels with bridgeContext.getDocumentSize() method.

Hope this helps,
Thierry.



---------------------------------------------------------------------
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