xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: Retrieving the image height.
Date Thu, 03 Feb 2005 02:24:30 GMT
Litton, Tom - CEPM wrote:

> What is the most efficient way of retrieving the image height from the 
> DOM object?

    SVG is a scalable format so you need to define 'height'?
If your content is 'well behaved' you should be able to just
ask for the width/height attributes on the root element.

    The transcoder allows one to override these with hints
which you could also query.

> I've implemented my own transcoder which delegates to one of several 
> other transcoders.  However, before the delegation takes place I need to 
> do some calculations based on  the height of the image. 
> 
> Currently i'm calling transcode(document, s, transcoderoutput) on the 
> super class (SVGAbstractTranscoder), but that seems like a very 
> inefficient thing to do just to get the height.

     Well this depends, most of the transcoders need to do that
before they can output the image.  So what might be best would
be to subclass the transcoders you are delegating to so you can
insert your computations between when they call the parent
transcode method and when they actually create their output.

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